Introduction

Python is a beginner-friendly programming language. Example of a Python program:
# Gets the user's name and greets them
my_name = "Jason"
user_name = input("Enter your name: ")
print(f"Hello {user_name}, nice to meet you. I am {my_name}.\n")

# Gets the user's age and compares
my_age = 31
user_age = input("Enter your age: ")
difference = my_age - int(user_age)
print(f"I am {difference} years older than you.")
This program is made of five components:
  • variables - store values to be used later in the program
  • functions - perform some action
  • operators - assign and modify values
  • data - extra information given to the program
  • comments - notes that a person can read but are invisible to the computer

Exercise 1 of 4

Which of these stores a value to be used later in the program?

Exercise 2 of 4

Which of these performs some action?

Exercise 3 of 4

Which of these assigns and modifies values?

Exercise 4 of 4

Which of these are notes that a person can read but are invisible to the computer?