Course Content
Week 1: Getting Started
In week 1 the basis goal is to get started with the basics.
0/2
Week 2: Variables & Data Types
Variables are containers that computer programs use to store information pertinent to what that computer program will do. Data Types are the different types of Variables and how Python uses these variables when building logic
0/2
Week 3: Making Decisions
In both computer programs and the AI world, computer programs need a way to make decisions. Booleans and Conditionals provide a way to make this happen.
0/2
learning Python Programming and also Intro to Games

Lesson 2: Your First Python Program

Topics Covered:

  • Using input() to ask the user questions
  • Combining print() and input() to create interactive programs

Asking the User for Input

The input() function allows your program to ask the user for information. Example:

name = input("What is your name? ")
print("Hello, " + name + "!")

Activity: Create an Interactive Greeting

Ask the user for their favorite color and use print() to respond:

color = input("What is your favorite color? ")
print("Nice! " + color + " is a great color!")

Challenge Task

  • Ask the user for their name, favorite animal, and favorite food.
  • Then use print() to create a fun sentence like:
name = input("What is your name? ")
animal = input("What is your favorite animal? ")
food = input("What is your favorite food? ")

print(name + " loves eating " + food + " with a " + animal + "!")

Try It Yourself!

Open Python or your online editor and run the examples above. Modify them to make your own silly story.