Python Learning Series · @onlysamarrr · Day 1 / 30

Day 1: First Program

Day 1 teaches your first Python program: print() shows text on screen, a variable stores a value under a name, and a line starting with # is a comment that Python ignores.

Phase: Beginner · Reels: 1/450 – 5/450

Quick Answer

Day 1 teaches your first Python program: print() shows text on screen, a variable stores a value under a name, and a line starting with # is a comment that Python ignores.

What You Will Learn

Code

name = "Arhan"
lang = "Python"
# This is a comment, Python ignores it
print("Hello World")
print("My name is", name)
print(name, "is learning", lang)

Output

Hello World
My name is Arhan
Arhan is learning Python

Code Explained, Line by Line

  1. A variable is a named box: name = "Arhan" stores the text Arhan under the name name.
  2. print() displays whatever is inside its brackets on the screen.
  3. A line starting with # is a comment. It is only for humans to read; Python skips it completely.
  4. print() can show several things at once: print(name, "is learning") joins them with a space.
  5. Python is case-sensitive: Name and name are two different variables.
Common Mistake: A variable name cannot start with a number (1name is invalid), and = assigns a value while == compares two values. Mixing them up is the most common Day 1 error.

Real-Life Use

Every program you will ever write starts here: showing output, storing data in variables, and leaving comments for other developers.

Practice Task: Store your name and your favourite language in two variables and print them both in one line.

Test Yourself — MCQs

Select (tick) an option, then tap Check answer to see instantly whether your answer is right or wrong, with an explanation. You can change your answer and check again.

Q1. What does print("Hello") display?

Q2. What is x after x = 5?

Q3. Which symbol starts a comment in Python?

Today's 5 Reels (from the 90-Day Plan Excel)

1/450Conceptprint() se pehli line
2/450Live demoStrings aur quotes
3/450Common mistakeVariables
4/450QuizComments (#)
5/450Interview / real lifeQuiz: naam + language print
Day 2 →