Python: Print command - simply explained
Related Videos: Chapter 1: The Python Print Statement (May 2024).
The Print command is one of the first commands you learn when programming with Python. We show you how to use it in our Python Guide.
Use print command - how it works
The print command is one of the simplest commands ever:
- With the print command you can output numbers, letters, words and even whole sentences in the terminal.
- You can print these out with a command such as "print ('Hello. What's your name?')" (Without quotation marks). Here you write the text directly into the print command.
- Alternatively, you can also output values that are stored for a variable with the print command: "print (a)".
- You can now try out your print command: To do this, save the script via "File"> "Save as" and, after saving, you can output the script with [F5] or "Run"> "Run Module".
More tips about Python in our CHIP guides
Tip: You can find further programming tutorials on our Python programming language topic page. There we will show you, for example, how you can access HTML websites with Python.