0

Can anyone please help me to understand this code's operation.the result is 24 but how is it?

def main():     print(f(4)) def f(n):     s=1     for i in range(2,n+1):         s=s*i     return s main() # Call the main function The result is 24

27th Apr 2020, 6:21 AM
sumaiya sharmin
sumaiya sharmin - avatar
1 Odpowiedź
0
2,5 1=1*2 =2 3,5 2=2*3 =6 4,5 6=6*4 =24 Was it difficult?
27th Apr 2020, 6:28 AM
Abhay
Abhay - avatar