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...

5 Steps 1 min read Medium

Step-by-Step Guide

  1. 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.
  2. 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. ,
  3. Step 3: If you wish to combine multiple items to be printed at once

  4. Step 4: use the + sign to add them together

  5. 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

B

Brittany Diaz

Dedicated to helping readers learn new skills in practical skills and beyond.

29 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: