Confusion | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Confusion

Hey is 'exit()' has the same function as 'return'?

31st Aug 2021, 3:26 AM
Ervan
Ervan - avatar
2 Answers
+ 1
exit() is not the same as return. exit will exit the python code, while return will return the value/object from a function.
31st Aug 2021, 3:29 AM
you are smart. you are brave.
you are smart. you are brave. - avatar
+ 5
Ervan , here is a tutorial that demonstrates the use some exit variations: https://www.pythonpool.com/JUMP_LINK__&&__python__&&__JUMP_LINK-exit/
31st Aug 2021, 9:59 AM
Lothar
Lothar - avatar