In simple explanation return is used in python to exit or terminate a function and return a value.
In example if you use
We call the function myfunction()
And you will notice that it only print the return value 6 and terminate there.
It'll not print the remaining code after return.
Frankly it does exactly what it does in any other programming language, which is exit a subroutine or a main program. it may or may not return a value which could be a number or a list of values or a string. ☀️☀️
Return statement just gives the result of the input of that function called for. And that returned value can be stored in a variable for future reference(to use some where else) in the program. or you can directly print.