Coding and Viewing Your Results in Real-Time
CodeFriends offers a practice environment where you can learn Python and view code execution results in real-time without the need to install a complex development environment. All you need is your browser.
How do you display what you want on the screen?
Just like the word "print," you use print()
and place the desired content inside the parentheses.
To see the result of your code in real time, wrap it with the print()
function.
Note: A
function
is a reusable block of code that performs a specific task.
name = "CodeFriends" # Assign "CodeFriends" to the variable name print(name) # Print the value of the variable name
A variable
stores a value in a program, and the print()
function displays that value when placed inside parentheses.
We will cover variables and functions in more detail in future lessons.
Coding Practice
Enter the code print(1 + 2)
in the practice code editor.
For code readability, make sure to include a space on either side of the addition sign (+).
print(1 + 2)
Lecture
AI Tutor
Design
Upload
Notes
Favorites
Help
Code Editor
Execution Result