+ 2

About "return" statement

m a little bit confused about return how they work? different between return and print how to use return example plz

1st Nov 2017, 9:00 AM
Shyamal Bhatt
Shyamal Bhatt - avatar
3 Antworten
+ 30
print() means display text to the screen. ex. print(123) // output :123 return is keyword to return from a function i.e. break out of the function.  ex. def ex(): return 1 print(ex()) //output 1
1st Nov 2017, 9:45 AM
Nithiwat
Nithiwat - avatar
+ 2
still not properly understood can someone explain with 2 different example in different situation plz
1st Nov 2017, 3:08 PM
Shyamal Bhatt
Shyamal Bhatt - avatar
+ 1
how return work in loops or own made function?
1st Nov 2017, 3:08 PM
Shyamal Bhatt
Shyamal Bhatt - avatar