0
0
Pythonprogramming~10 mins

print() function basics in Python - Mini Project: Build & Apply

Choose your learning style9 modes available
print() function basics
📖 Scenario: You are learning how to show messages on the screen using Python. This is like writing a note on a board for others to see.
🎯 Goal: Learn how to use the print() function to display text and numbers.
📋 What You'll Learn
Create a variable with a message
Create a number variable
Use print() to show the message
Use print() to show the number
Use print() to show both message and number together
💡 Why This Matters
🌍 Real World
Showing messages and information on the screen is the first step in making programs that communicate with users.
💼 Career
Understanding how to display output is essential for debugging and creating user-friendly applications.
Progress0 / 4 steps
1
Create a message variable
Create a variable called message and set it to the text "Hello, world!".
Python
Need a hint?

Use quotes around the text to make it a string.

2
Create a number variable
Create a variable called number and set it to the number 42.
Python
Need a hint?

Just write the number without quotes.

3
Print the message and number separately
Use print() to show the message variable on one line, and then use print() to show the number variable on the next line.
Python
Need a hint?

Use two separate print statements, one for each variable.

4
Print message and number together
Use one print() statement to show both message and number together separated by a space.
Python
Need a hint?

Use a single print with both variables separated by a comma.