Learn Python

Lesson 1

  • Welcome

  • Walkthrough replit

  • print()

  • Common coding errors

    • Print('hello')

    • print 'hello'

  • Fix my code

print(hello world)
Print('123')
print('hello world');
print 'abcxyz'

Here's an exercise to practice the print statement in Python:

# Exercise: Printing Messages
# Write a Python program that prints different messages to the console.

# Instructions:
# 1. Print a message that says "Hello, world!"
# 2. Print your name.
# 3. Print your favorite quote.
# 4. Print a message with a number variable.
# 5. Print the result of a calculation.

# Example:
# Hello, world!
# Your Name
# "Favorite Quote"
# Your age is: 25
# 5 + 2 = 7

print("Hello, world!")
print("Your Name")
print("\"Favorite Quote\"")
number = 25
print("Your age is:", number)
print("5 + 2 =", 5 + 2)

Another exercise:

Lesson 2

  • Taking user input input('What's your name?')

  • Variables

  • Printing a variable

  • Common coding errors

    • my variable = input('What is your name?') then print(my variable)

    • myDad = input('What is your dad's name?') then print(mydad)

  • Naming convention

    • Starts with A-Z or a-z or _

    • Follows by other normal characters

    • No special characters: #, @, ?, %, +

  • Fix my code

  • Challenge

Lesson 3

  • Concatenation

  • Common coding errors

Last updated