Preplp
Daily Python
Day 1Python~25 min

Hello, Python

Your first prints, variables, and user input

Track progress0/15 days
x

What you'll learn

print()f-stringsvariablesinput()
  • Run your first Python program
  • Display text and numbers with print
  • Ask the user for input and personalize output
  • Build a small welcome message project

Lesson & examples

Read the code, then the explanation — try changing values before the project.

Hello World
print("Hello, Python World!")
print("The number is", 4)
print("2 + 2 =", 3 + 2)

print() sends text to the screen. You can pass several values separated by commas — Python adds spaces between them.

  • print("Hello, Python World!")

    A string in quotes is printed exactly as written.

  • print("The number is", 4)

    Mixing text and a number in one print — no need to convert 4 to a string.

f-strings
name = "Vivian"
print(f"Hello, {name}! Welcome to Python Programming")

f-strings let you embed variables inside text with curly braces.

  • name = "Vivian"

    Stores text in a variable for reuse.

  • f"Hello, {name}!"

    The f before the quotes means: insert the value of name here.

User input
userName = input("What is your name? ")
print(f"Hello, {userName}! Welcome to Python Programming")

input() pauses the program and waits for the user to type. It always returns a string.

  • input(...)

    Whatever the user types is saved into userName.

Today's exercise: Welcome Message Generator

Create a program that asks for the user's name and favorite hobby, then prints a friendly welcome message.

Steps

  1. 1

    Ask for name

    Use input() to ask: "What's your name?" and store the answer in a variable called name.

  2. 2

    Ask for hobby

    Ask: "What's your favorite hobby?" and store it in hobby.

  3. 3

    Print the welcome block

    Print a blank line, a header, then use f-strings to greet the user and mention their hobby.

Full project source — copy into a folder or use the zip above

starter.py
# Welcome Message Generator

name = input("What's your name? ")
hobby = input("What's your favorite hobby? ")

print("\n--- Welcome Message ---")
print(f"Hello, {name}!")
print("Welcome to the world of Python Programming.")
print(f"It's great to know that you love {hobby}.")
print("Get ready to build something amazing today.")

Code explained

  1. 1.Collecting input

    Two input() calls mean two questions. Each answer is stored in its own variable so you can use them later in print statements.

    Snippet
    name = input("What's your name? ")
    hobby = input("What's your favorite hobby? ")
  2. 2.Formatting output

    print("\n--- ...") prints a blank line then a header. f-strings personalize the message with the values the user typed.

    Snippet
    print(f"Hello, {name}!")
    print(f"It's great to know that you love {hobby}.")

Sample output

What's your name? Alex
What's your favorite hobby? coding

--- Welcome Message ---
Hello, Alex!
Welcome to the world of Python Programming.
It's great to know that you love coding.
Get ready to build something amazing today.

One rehearsal platform

Certification mocks, daily lessons, project labs, and in-browser drills

Structured for exam day and portfolio proof — timed tests, guided builds, and quick reps on one platform.