

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What does print() function do in Python?
In Python 3, print() is a built-in function (object) that is used to print the argument we give it to the screen. For example,
>>> print("Hello!") Hello! >>> print(5) 5
Before this, print was a statement. It could be used in the following way:
>>> print "Hello!" Hello! >>> print 5 Hello
It evaluates each expression in turn and writes the resulting object to standard output. If an object is not a string, it is first converted to a string using the standard rules for string conversions. The (resulting or original) string is then written to the screen. You can read more about why the print statement was converted to a function in Python 3 here: https://docs.python.org/3.0/whatsnew/3.0.html#print-is-a-function
- Related Questions & Answers
- What does raw_input() function do in python?
- What does input() function do in python?
- What does open() function do in Python?
- What does close() function do in Python?
- What does reload() function do in Python?
- What does os.pipe() function do in Python?
- What does getattr() function do in Python?
- What does hasattr() function do in Python?
- What does setattr() function do in Python?
- What does delattr() function do in Python?
- What does "print >>" do in python?
- What does the repr() function do in Python Object Oriented Programming?
- What does the str() function do in Python Object Oriented Programming?
- What does the cmp() function do in Python Object Oriented Programming?
- What does the .end() function do in jQuery?
Advertisements