How to Print in Python
Work out which python you are running., Type in print followed by a space then whatever you wish to be printed., If you wish to combine multiple items to be printed at once, use the + sign to add them together, and the str() function to convert them...
Step-by-Step Guide
-
Step 1: Work out which python you are running.
Macs and Linux come with Python 2 installed but you've installed it yourself or are on a Windows machine, it may be Python
3.
When you open a Python shell (via the IDLE development tool that comes with Python) or by typing python into the terminal on Mac, the version number of the Python being used will be displayed. -
Step 2: Type in print followed by a space then whatever you wish to be printed.
If you are using Python 3 putting brackets around the thing to be printed is required. , -
Step 3: If you wish to combine multiple items to be printed at once
-
Step 4: use the + sign to add them together
-
Step 5: and the str() function to convert them before addition (put the item to be converted in the brackets).
Detailed Guide
Macs and Linux come with Python 2 installed but you've installed it yourself or are on a Windows machine, it may be Python
3.
When you open a Python shell (via the IDLE development tool that comes with Python) or by typing python into the terminal on Mac, the version number of the Python being used will be displayed.
If you are using Python 3 putting brackets around the thing to be printed is required. ,
About the Author
Brittany Diaz
Dedicated to helping readers learn new skills in practical skills and beyond.
Rate This Guide
How helpful was this guide? Click to rate: