DEV Community

Cover image for Python Day Two : The Start of Real Coding
Amina
Amina

Posted on

Python Day Two : The Start of Real Coding

Python Day Two : Python Output & Print

print() is a Python🐍 command used to show something on the screen.
Example:

print("Pure Pearl Foundation")
Enter fullscreen mode Exit fullscreen mode
  • 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
Enter fullscreen mode Exit fullscreen mode

Print Number

print() can also display numbers in Python.
Example:

print(70)
print(80)
print(90)
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Calculation

You can do calculations directly inside print() in Python.
Example:

print(10+10)
print(20-20)
print(50/5)
print(5*5)
Enter fullscreen mode Exit fullscreen mode

Explanation:

  • + means addition
  • - means subtraction
  • / means division
  • * means multiplication

Output:

20
0
10.0
25
Enter fullscreen mode Exit fullscreen mode

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")
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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)