What does the return statement do in Python

0 votes

How do we use the return statement in Python and what is the purpose of it? Also, what is the difference between return statement and print statement?

Oct 1, 2018 in Python by ana1504.k
• 7,910 points
1,053 views

1 answer to this question.

0 votes

The print() function is use to write or "print" a string in the console whereas a return statement lets your function to exit and hand back a value to its caller.

The return statement in python is used when a function is ready to return a value to its caller.

answered Oct 1, 2018 by SDeb
• 13,300 points

Related Questions In Python

0 votes
1 answer

What does the random.triangular(low, high, mode) function do in python?

It returns a random floating point number ...READ MORE

answered May 27, 2019 in Python by Vinod
917 views
0 votes
1 answer

What to do when len() does not return the number of integers in range(1,100)?

You can use the following code block: x=range(1,100) len(x) Output: ...READ MORE

answered May 28, 2019 in Python by Fata
• 1,050 points
564 views
0 votes
1 answer

What does the map() method do in Python?

The map() function in Python is a ...READ MORE

answered Jun 17, 2019 in Python by anonymous
579 views
0 votes
1 answer

What does the penup() do in Python(turtle module)

penup() basically makes sure that the moving ...READ MORE

answered Jun 21, 2019 in Python by Iris
5,816 views
+3 votes
2 answers

What does Python _init_ and self do?

Hey @Anirudh!  Self The self keyword is used to access ...READ MORE

answered Oct 31, 2018 in Python by Omkar
• 69,210 points
5,956 views
+1 vote
1 answer

What does the Raise keyword do in Python?

Hi! I think I can answer this - ...READ MORE

answered Jan 25, 2019 in Python by Nymeria
• 3,560 points
864 views
0 votes
2 answers
0 votes
1 answer

What does hash do in python?

A hash is an fixed sized integer ...READ MORE

answered Oct 15, 2018 in Python by SDeb
• 13,300 points
479 views
0 votes
1 answer

What are the ternary conditional operator in Python?

The Ternary Conditional operator was added in ...READ MORE

answered Sep 19, 2018 in Python by SDeb
• 13,300 points
538 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP