Skip to content

Latest commit

 

History

History

02-first-program

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Lesson 02: Your First Python Program

Part of Python: Zero to Warrior, a free Python course for beginners. Video: https://youtu.be/U5zgHkmNhbo · Full course: https://www.youtube.com/playlist?list=PLcsbg964FAwc

What's in this lesson

  • print() shows text on the screen. The text goes inside quotes, which makes it a string.
  • A line that starts with # is a comment: a note for people. Python skips it.
  • Python runs a file from the top to the bottom, one line at a time.
  • print() with nothing inside prints an empty line.

Files

  • solution.py: the program from the video.
  • starter.py: the "your turn" exercise, with TODOs to fill in.

Run it

python3 solution.py      # Mac
python solution.py       # Windows

Practice

  1. Print three lines about yourself: your name, a hobby, and why you're learning Python.
  2. Comment out the middle line. Run it again. What changed?
  3. Make the mistake on purpose: change print to Print and run it. Read the last line of the error, then fix it.