Python Output Variables


Output Variables

The Python print statement is often used to output variables.

Example

x = "Python is awesome"
print(x)
Try it Yourself »

To combine both text and a variable, Python uses the + character:

Example

x = "awesome"
print("Python is " + x)
Try it Yourself »

You can also use the comma character , to print more than one string/variable:

Example

x = "awesome"
print("Python is", x)
Try it Yourself »


Copyright 1999-2023 by Refsnes Data. All Rights Reserved.