playground-title

Demo

Curious about how CodeFriends works? Try our interactive class demos to get a feel for the learning experience — complete with hands-on coding, real-time feedback, and built-in AI guidance every step of the way.

Python
Web Development
Office Automation
Data Analysis
AI & ML
Other Demos
Lecture

Printing Output in Python

The print() function, which means "to output" in English, displays the data inside parentheses ( ) on the screen.


How Do You Use It?

Simply input the data you want to output inside the parentheses, and that's it!

Using the print() Function
print("Python") # Outputs the string "Python" print(123) # Outputs the number 123 message = "CodeFriends" # Assigns "CodeFriends" to the variable message print(message) # Outputs the value stored in the variable message

Printing Multiple Data Items at Once

By using a comma (,) inside the print function, you can output multiple items simultaneously.

Each item separated by a comma is divided by a whitespace.

Printing Multiple Data Items
name = "CodeFriends" age = 20 print(name, "is", age, "years old") # Outputs "CodeFriends is 20 years old"

Coding Practice

Enter print(4 / 2) into the practice code editor.

"print(4 / 2)" outputs the result of dividing 4 by 2. In Python, division is performed using the slash symbol(/), and the result is returned as a floating-point number.

Thus, the result of 4 / 2 is a floating-point number 2.0 instead of an integer 2.

Quiz
0 / 1

Complete the function to display data on the screen in Python.

('Hello, World!')
print
display
show
output

Lecture

AI Tutor

Design

Upload

Notes

Favorites

Help

Code Editor

Run
Generate

Execution Result

Loved the Demo? Let's Keep Building.

Whether you're an individual learner or part of an institution — be it a school, training provider, or business looking to upskill your team — CodeFriends offers flexible, scalable solutions tailored to your unique goals and needs.

For Individuals

For Individuals

Get more than just lessons — with flexible plans priced below a textbook, you get unlimited courses, AI-powered help, and real projects you’ll be proud to share.

For Institutions

For Institutions

Empower your organization with scalable, hands-on tech training — featuring AI-powered admin dashboards and white-labeled LMS platforms, tailored to your needs.