Python Day Two : Python Output & Print
print() is a Python🐍 command used to show something on the screen.
Example:
print("Pure Pearl Foundation")
- print → tells Python to display output
- "Pure Pearl Foundation" → the text to show on the screen
- Text must be inside quotation marks " "
Output:
Pure Pearl Foundation
Print Number
print() can also display numbers in Python.
Example:
print(70)
print(80)
print(90)
Explanation:
- Numbers are written without quotation marks.
- Python treats them as real numbers, not text.
- Each print() shows the number on a new line.
Output:
70
80
90
Calculation
You can do calculations directly inside print() in Python.
Example:
print(10+10)
print(20-20)
print(50/5)
print(5*5)
Explanation:
- + means addition
- - means subtraction
- / means division
- * means multiplication
Output:
20
0
10.0
25
combine text and numbers
You can combine text and numbers in one print() statement by separating them with commas.
Example:
print("Pure Pearl Foundation has", 15, "Student Volunteers")
Explanation:
- "Pure Pearl Foundation has" → text
- 15 → number
- "Student Volunteers" → text
- Commas , join them together in one output. Output:
Pure Pearl Foundation has 15 Student Volunteers
Every expert programmer started as a beginner. Keep practicing, stay consistent, and trust the learning process. Small steps lead to big success. 🚀💻
Top comments (0)