Git Product home page Git Product logo

python-for-absolute-beginners-course's Introduction

Python for Absolute Beginners Course

Code samples and other handouts for our course. See the practice exercises for following along with the course.

Course Summary

Learning to program can be overwhelming. Concepts and facts come at you fast and most courses don't cover many of them at all or at a beginner's pace. This is not most courses. Python for absolute beginners is our premier course for beginning developers. We start at the very beginning, teaching you the big ideas and concepts covered in a CS 101 course. Then we move on to writing increasingly complex code and applications in Python.

What students are saying

Python for Beginners was really well done, I have CodeAcademy and LinkedIn Learning (not bad mouthing them) but until I had your program I was really struggling. Course curriculum is very good. Thanks for putting this together.

What's this course about and how is it different?

Most courses teach you the facts of programming and Python. Here is how a loop is constructed. Here is how you test a condition and make your program choose one path or another. Often they assume that you are familiar with programming concepts such as data types, loops, functions, and so on and that you just need to learn the details of how to do this in Python.

This course is not most courses. If you want ground up coverage of software development using Python as the technology, this is your course!

We spend significant time setting the stage to make sure you have the big concepts clearly covered before diving into writing code. We explicitly discuss how to approach problem solving when writing code so that you don't have that deer in the headlines feeling.

And the course content isn't just facts. You will see a lot of code written before your eyes. That code isn't boring foo() this and bar() that. We build several fun and challenging games covering a wide range of topics that will be entirely relevant to your professional projects.

If you never had that formal computer science background but need to jump into programming and Python, this course has your back.

What topics are covered

In this course, you will:

  • Learn how to install Python and a proper editor to write code on your computer.
  • See a quick, high-level overview of the big ideas of computer programming (e.g. data structures).
  • Understand how Python executes a program and turns what you write into executable software.
  • See how Python defines data types (integers, strings, etc.) and how to convert between them.
  • Create interactive code that has a conversation with the user or data.
  • Use functions to make your code more maintainable and reusable.
  • Choose the right data structure to significantly improve the clarity and performance of your code.
  • Create a basic AI / computer opponent for the games built during the course.
  • Learn many problem solving techniques to help you dive right into writing code productively.
  • See resources to help visualize connections between data created by your code.
  • Work with multiple file formats to read and write data as our program runs.
  • Use external libraries from pypi.org.
  • Add error handling to your application for a polished, reliable application.
  • And lots more

View the full course outline.

Who is this course for?

This course is for anyone who wants to learn Python and computer programming. If you haven't had a formal education in software development or have tried other courses and programming "didn't stick", then you are a great candidate student.

The student requirements are quite light for this course. You'll need:

  • Basic typing skills
  • Foundational computer experience (installing software etc.)
  • A simple computer (macOS, Windows, or Linux)
  • A desire to learn programming

Note: All software used during this course, including editors, Python language, etc., are 100% free and open source. You won't have to buy anything to take the course.

What games will we build?

I believe it's important to learn programming in the context of something that feels plausible and real. We won't build a bunch of disconnected loops and other programming examples that don't relate back to real programs. We will build several fun games that cover meaningful content that any elementary Python course would cover.

  1. Guess the number of M&Ms in a jar
  2. TIC-TAC-TOE
  3. Rock-Paper-Scissors (3-way and 7-way)
  4. A Connect4 clone

The time to act is now

If you've always wanted to learn programming and are considering Python as your gateway into that world, this is the course for you. We will fill in the concepts that would normally be covered in a CS 101 course without wasting your time taking semesters to cover what can be learned and practiced in a week or two.

Dive into Python and become a software developer with this course. Join today! You've got nothing to lose. Every one of our courses comes with a 2-week money-back guarantee.

Visit the course page to sign up.

python-for-absolute-beginners-course's People

Contributors

amcinnes87 avatar kofilpy avatar mikeckennedy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-for-absolute-beginners-course's Issues

Add Sorting Algorithms

Write clean and clear data of all sorting algorithms as they are very important when it comes to optimizing the data.

Chapter 7 error after adding outcome.get

Hey, I keep getting this issue when I add outcome.get, It points out to,

main() at the bottom of the script
function play_game(player, player2) in main
roll1 = get_roll(player_1, roll_names) in play_game
return rolls[selected_index]

my version of python is 3.8

`import random

rolls = {
'rock': {
'defeats': ['scissors'],
'defeated_by': ['paper']
},
'paper': {
'defeats': ['rock'],
'defeated_by': ['scissors']
},
'scissors': {
'defeats': ['paper'],
'defeated_by': ['rock']
},
}

def main():
show_header()

player = "You"
player2 = "Computer"

play_game(player, player2)

def show_header():
print("------------------------")
print(" Rock, Paper, Scissors v2")
print(" Data Structures Edition")
print("------------------------")

def play_game(player_1, player_2):
rounds = 3
wins_p1 = 0
wins_p2 = 0

roll_names = list(rolls.keys())

while wins_p1 < rounds and wins_p2 < rounds:
    roll1 = get_roll(player_1, roll_names)
    roll2 = random.choice(roll_names)

    if not roll1:
        print("try again")
        continue

    print(f"{player_1} rolls {roll1}")
    print(f"{player_2} rolls {roll2}")

    # test for a winner
    winner = check_for_winner(player_1, player_2, roll1, roll2)

    print("The end of the Round")
    if winner is None:
        print("It was a tie!")
    else:
        print(f"{winner} is the winner of the round!!!")
        if winner == player_1:
            wins_p1 += 1
        elif winner == player_2:
            wins_p2 += 1

    print(f"Score is {player_1}: {wins_p1} and {player_2}: {wins_p2}")

if wins_p1 >= rounds:
    overall_winner = player_1
else:
    overall_winner = player_2

print(f"{overall_winner} wins the game!")

# Rock
#   Rock -> tie
#   Paper -> lose
#   Scissor -> win
# Paper
#   Rock -> win
#   Paper -> tie
#   Scissor -> lose
# Scissor
#   Rock -> lose
#   Paper -> win
#   Scissor -> tie

def check_for_winner(player_1, player_2, roll1, roll2):
winner = None
if roll1 == roll2:
print("It's a tie!")

outcome = rolls.get(roll1, {})
if roll2 in outcome.get('defeats'):
    return player_1
elif roll2 in outcome.get('defeated_by'):
    return player_2
return winner

def get_roll(player_name, roll_names):
print("Available rolls:")
for index, r in enumerate(roll_names, start=1):
print(f"{index}. {r}")

text = input(f"{player_name} what is your roll? : ")
selected_index = int(text) - 1

if selected_index < 0 or selected_index >= len(rolls):
    print(f"sorry {player_name}, {text} is not a vaild play!")
    return None

return rolls[selected_index]

if name == 'main':
main()
`

Add new feature :: Data structure example

Add data structure example i.e. Nested list, Counter, Lambda function, Sorting, deque, heap.

While solving any kind of problem, the data structure is important. I want to contribute to this repository by adding examples on the above topics with proper documentation.

Basically, each of the topics will contain motivation, use case, example, dos, and don't-s.

Here's an example:

Initializing a nested list in this format [ [ v ] * n ] * n is not always a good idea.

Look at the snippet below:

>>> a = [ [0] * 3 ] * 3
>>> a
[[0, 0, 0], [0, 0, 0], [0, 0, 0]]
>>> a[0][0]=1
>>> a
[[1, 0, 0], [1, 0, 0], [1, 0, 0]]

So all of the 0th element of the lists got changed.
It's because * is copying the address of the object (list).

Like this

07-word-completion-basic-edition

I have been working on this addition to the RPS game. I have installed prompt-toolkit 3.0.5. As I have been coding along with you, I have received the following error:
File "/PycharmProjects/RPS/RPS-v8.py", line 157
word_comp: object = word_completer(roll_names)
^
SyntaxError: invalid syntax

I can't figure out what is causing the error as I have attempted to follow your code...there were some differences that came up when I entered the WordCompleter...the autofill had me use word_completer for example. Below is the section of code that relates:

def get_roll(player_name, roll_names):
print(f"Available rolls: {', '.join(roll_names)}"
# for index, r in enumerate(roll_names, start=1):
# print(f"{index}. {r}")

word_comp = word_completer(roll_names)
roll = prompt(f"{player_name}, what is your roll: ", completer=word_comp)

text = input(f"{player_name}, what is your roll?")
selected_index = int(text) - 1

if not roll or roll not in roll_names:
    print(f"Sorry {player_name}, {roll} is not valid!")
    return None

return roll

Problem with functions

image
image
image
image

I'm not really sure how to use functions and what the functions' brackets do. My code was working perfectly before I started adding functions and then I tried following what the errors told me, but it's not working for me. Can someone please tell me what I have to do?

CH 6. Adding the best-of feature

This lesson was a MESS.... i couldnt understand S***... you go so fast on everything....

You select, copy, paste, write so fast... i had to watch it 3 times and i still cand keep it up.

Thumb down!

Tic Tac Toe

I'm working through the lecture on building a Tic Tac Toe game. I have followed your suggestion of putting 3 None data types into my lists to build the board. Unfortunately, my program won't run because I keep the following errors:
//PycharmProjects/tictactoe/game.py:21: SyntaxWarning: list indices must be integers or slices, not tuple; perhaps you missed a comma?
[None, None, None]
Traceback (most recent call last):
File "//PycharmProjects/tictactoe/game.py", line 77, in
main()
File "//PycharmProjects/tictactoe/game.py", line 21, in main
[None, None, None]
TypeError: list indices must be integers or slices, not tuple

Is there some way I can change the program to get it to run? I have been following the steps you've taken exactly but don't achieve the same results. Any direction you can provide would be helpful. Thank you.

Connect 4 game

I wish to add a Connect 4 game made in Python. I think it will be a great lesson involving def functions and classes.

Ch 6 - Cleaning up with functions question

Hi Michael and everybody. This might be a pointless question but when introducing functions into our more "rudimentary" code and defining them, I see you "take in" (not sure what you mean by that) player_1 and player_2 into the "play_game" function. So:
def play_game(player_1, player_2):
I'm guessing this is because the function will need these two variables. But I don't understand why then, when defining the main() function at the top we change the names of these variables in the play_game function. "(player, ai)"
And furthermore, now that we have changed them we don't have to go back down to the defining play_game lines to change (player_1, player_2) into (player, ai)
To make the question simple I just don't understand why we needed to change these variables names only at the top when defining the main() function but leaving different variable names when defining the play_game function.

Thank you very much for your time!

How to install Git

Hello,

It might be a strange question but ive had a hard time installing git in windows (Yes, im stuck in the set up part of lecture). I actually dont undestand whats all the stuff its asking me. Do i just leave everything as is and install it? (Next, Next, Next)
What components should i install?
PyCharm is the text editor, but i tried to add it in other and the Test Custom editor fails.
Then there is the PATH Selection, the HTTPS, The line ending conversions, etc.

In short, I need a bit of guidence.

In PYCharm I installed the paths too, I hope that was right.

Thanks in advance for the help!

Korean translation

Hello. I'd like to translate this for my school assignment. Can I simply translate a few things?

Rock_Paper_Scissors player1 v player_1

In Ch 9 rpsgame.py, you use the variable "player1" in the main function, but everywhere else you use the variable "player_1". What's going on here? Your code works in the tutorial, but I'm unable to follow why. I'm also wondering if it's good practice to use both variables.

Thanks for your time,
Daniel

Color Labels

I am not able to get the virtual environment (neither in CMD or in the terminal) to interpret colors. What I'm getting is the ANSI escape codes instead of the actual colors.

Looking at StackOverflow, you'll need to also import init in colorama and add init(convert=True).

I just figured that out, but you may want to consider altering some the lectures. Or I totally missed it.

Chapter 9 Rock Paper Scissors

I have been having issues following along with getting errors that seemed inconsistent with what I thought I should be getting. So, I copied your source for Chapter 9 (linky) and I got the following errors:

Traceback (most recent call last):
File "(you don't need to see my roots)/RPS1.py", line 181, in
main()
File "(you don't need to see my roots)/RPS1.py", line 14, in main
show_leaderboard()
File "(you don't need to see my roots)/RPS1.py", line 31, in show_leaderboard
leaders = load_leaders()
File "(you don't need to see my roots)/RPS1.py", line 152, in load_leaders
return json.load(fin)
File "(you don't need to see my roots)\Programs\Python\Python38-32\lib\json_init_.py", line 293, in load
return loads(fp.read(),
File "(you don't need to see my roots)Programs\Python\Python38-32\lib\json_init_.py", line 357, in loads
return _default_decoder.decode(s)
File "(you don't need to see my roots)\Programs\Python\Python38-32\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "(you don't need to see my roots)\Programs\Python\Python38-32\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Process finished with exit code 1

I'm getting the same errors when I'm working on my own sheet along with you and I'm on the Demo: Saving Wins lecture.

So, if I'm reading this correctly, the JSON library is not consistent with what you are wanting it to do. How would I update this library?

Invalid literal for int() with base 10:

There's a very real chance I'm doing something wrong here so forgive me. After copying the code from

python-for-absolute-beginners-course/code/06-organizing-code-with-functions/rocks-game/rpsgame.py

the program runs the header, lists available rolls, then requests a roll. after submitting a roll I ge thit with this error:
Screenshot 2021-04-15 113029

apologies if I'm missing something obvious, much appreciated.

Ch10 - Issue using prompt_toolkit

I was trying to use the prompt_toolkit thing and the program crushed, here's the error that pycharm shows:
"ModuleNotFoundError: No module named 'prompt_toolkit'"

It gives me the feeling that this is a trifle, and even so I haven't been able to fix it. Thank you in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.