0
I have make a factorial programe that is
def factorial(x): x=int(input("enter first no")) fact=1 for i in range(1,x): fact=fact*i return fact z=factorial(x) print("the factorial ",z) the error was:- 'return' is outside
14 Respostas
+ 2
see the code again. i changed it a bit.
+ 2
Your for loop is indented wrongly.
+ 2
you're welcome.
+ 1
to the function? it is not necessary in this case.
+ 1
got to my other answer with the code.
+ 1
Arguments are used to pass information to a function. Otherwise, they are unnecessary.
0
bro I want to make it by for loop
0
s.c. I want to ask one question why have we given any argument to for for loop
0
bro tell me why you have not given any argument to for loop plz
0
can we make it with arguments
0
send me
0
thnx bro