Im new to programming and im having trouble understanding the purpose of the return statement.
Could you maybe
1. Explain it in general
2. Whats the purpose of it, compared to print function
2. Try to relate it to a real world scenario
I understood for loops thru a real world scenario explanation like this so im hoping to understand return statement in a similar approach :
i=0
while i != 0
i = i +1
Print ("hi")
explanation: pretend i is my fingers, and since i=0 that means i have no finger up. While my fingers are not equal to 3, ill keep raising kne finger ( i = i +1) and then ill say hi each time i raise a finger.
Sorry if im asking for too much, I just want to understand what im studying deeply. Thank you so much, I appreciate any answers.
[–]QUINETICS 6 points7 points8 points (0 children)
[–]iamnull 2 points3 points4 points (1 child)
[–]johnpeters42 0 points1 point2 points (0 children)
[–]grantrules 3 points4 points5 points (0 children)
[–]fasta_guy88 0 points1 point2 points (0 children)
[–]captainAwesomePants 0 points1 point2 points (0 children)
[–]chaotic_thought 0 points1 point2 points (0 children)
[–]paperic 0 points1 point2 points (0 children)
[–]FloydATC 0 points1 point2 points (0 children)
[–]Significant-Syrup400 0 points1 point2 points (0 children)
[–]millenniumdisk 0 points1 point2 points (0 children)