+ 1
return or print?
can anybody explain the difference between print and return ? and where we should use each of them?
3 Answers
+ 11
Similar posts available use search bar before posting ur question
Hope it may helps u
https://www.sololearn.com/discuss/2263897/?ref=app
https://www.sololearn.com/discuss/2037439/?ref=app
https://www.sololearn.com/discuss/1875576/?ref=app
https://www.sololearn.com/discuss/243524/?ref=app
https://www.sololearn.com/discuss/1416697/?ref=app
https://www.sololearn.com/discuss/1919961/?ref=app
https://www.sololearn.com/discuss/1952697/?ref=app
https://www.sololearn.com/discuss/21870/?ref=app
https://www.sololearn.com/discuss/887943/?ref=app
+ 2
when you want to stop your function return
0
Cool codes is return:
def x_bigger_than_y(x, y):
return True if x > y else False
x_bigger_than_y(3, 2) #Outputs True