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
functionis 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)
Lessons in this chapter · Master the Fundamentals of Python
- 1. What is Programming and What Benefits Can You Gain from Learning It?
- 2. Coding and Viewing Your Results in Real-Time
- 3. Are There Levels in Programming Languages?
- 4. Features of Python and Simple Code Example
- 5. Reasons Why Python is Popular
- 6. Why is Indentation Important in Python?
- 7. Printing Output in Python
- 8. Getting User Input in Python
- 9. Multiple-choice quiz
- 10. Statements and Expressions
- 11. Predefined Reserved Words in Python - Keywords
- 12. How to Name Variables and Functions Sensibly
- 13. Explaining Code with Comments
- 14. What are Identifiers?
- 15. A Container for Data, Variables
- 16. Important Points When Assigning Values to Variables
- 17. Symbols for Performing Operations, Operators
- 18. Literals Representing Data
- 19. Coding Quiz - Return 10 Times the Given Number
- 20. Multiple-choice quiz
- 21. Fill-in-the-blank quiz
Lecture
AI Tutor
Design
Upload
Notes
Favorites
Help