Print Single and Multiple variable in Python

In Python 3.0, the print statement is written as print() function. Below are codes in Python 3.0 that shows the process of printing values in Python.

Example 1: Printing Single value

filter_none

edit
close

play_arrow

link
brightness_4
code

# Equivalent codes in Python 3.0
# (Produces same output)
  
# Code 1:
print(1)
  
# Code 2 :
print((1))

chevron_right


Output:

1 
1

Example 2: Printing multiple values

filter_none

edit
close

play_arrow

link
brightness_4
code

# Code 1:
print(1, 2)
  
# Code 2:
print((1, 2))

chevron_right


Output:



1 2
(1, 2)

This article is contributed by Arpit Agarwal. If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above

Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.

My Personal Notes arrow_drop_up
Article Tags :

14


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.