What is the difference between print and return in python?

+1 vote
If we get the same output why not just use print?
May 23 in Python by Waseem
• 4,480 points

edited May 24 by Omkar 230 views

1 answer to this question.

+1 vote

Return statements end the execution of a function and if return is not given  by default it returns None.

Print statement shows the human user a string representing what is going on inside the computer

answered Aug 25 by anonymous

Related Questions In Python

0 votes
1 answer

What is the difference between print and pprint in Python?

As per the documentation,  The pprint module provides a capability ...READ MORE

answered Jul 8 in Python by Arvind
• 2,960 points
341 views
+1 vote
1 answer

What is the difference between range and xrange functions in Python 2.X?

xrange only stores the range params and ...READ MORE

answered Aug 22, 2018 in Python by Priyaj
• 56,960 points
309 views
0 votes
0 answers

What is the difference between isdigit, isnumeric and isdecimal in python?

Can you give examples for each of ...READ MORE

May 31 in Python by Waseem
• 4,480 points
352 views
0 votes
1 answer

What is the difference between str() and repr() functions in Python?

str() is mostly used to create output ...READ MORE

answered Jul 8 in Python by Arvind
• 2,960 points
125 views
0 votes
1 answer

What is the key difference between self in ruby and self in python?

Ruby and Python are actually very different languages (although ...READ MORE

answered Jul 30 in Python by Mohammad
• 3,170 points
31 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 395 views
+4 votes
6 answers