+ 1

Python . What does make sense to Put in the function the command Return cause .....

.print(seconds) return seconds the result must be nothing but the result is still "seconds" but just explain me why do I should to use return sometimes in the functions

20th Aug 2020, 6:36 PM
Kir-Py
Kir-Py - avatar
4 Respostas
0
The return is used in cases where you have to save a value to use it in other blocks of codes, sometimes you don't really need to return something because you won't need the value, you just need to print it on screen. When you don't return a value is called a void function, that's something that you will not see on python but I recommend you learn the basics of C++, C# or Java to can understand better this kind of subjects. Have a nice day đŸ§đŸŒâ€â™€ïžđŸ§đŸŒâ€â™€ïžđŸ§đŸŒâ€â™€ïž
20th Aug 2020, 6:59 PM
Ariadne Rangel
Ariadne Rangel - avatar
0
Ariadne Rangel thank you , and how I will know where is the new Block of Codes??
20th Aug 2020, 7:19 PM
Kir-Py
Kir-Py - avatar
0
Kir-Py the blocks of code are basically the classes and functions on your script. It's a bit complicated explain it here so feel free to send me a DM if you have doubts. đŸ™‡đŸŒâ€â™€ïžđŸ™‡đŸŒâ€â™€ïžđŸ™‡đŸŒâ€â™€ïž
20th Aug 2020, 7:28 PM
Ariadne Rangel
Ariadne Rangel - avatar