What this error want to say? Can't we use return without function?

Shivlal Sharma sshivlal9601 at gmail.com
Mon Sep 7 03:34:51 EDT 2020


On Monday, 7 September 2020 at 12:57:16 UTC+5:30, Python wrote:
> Shivlal Sharma wrote: 
> > N = int(input("enter a positive integer:")) 
> > coun = 1 
> > while (N > 0): 
> > coun = coun * N 
> > N = N - 1 
> > return coun 
> > nice = ntime(N) 
> > print(nice) 
> > 
> > 
> > error: return outside of the function
> What did you expect return out of a function to even mean?
I mean that can't we use return keyword outside of the function?


More information about the Python-list mailing list