We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
ip=int(input())ifip<0:print("Input is negative number. Factorial is only for positive numbers and not for negative numbers")elifip==0:print("The factorial of 0 is 1")else:op=1foriinrange(1,ip+1):op=op*iprint(op)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Security Encryption Scheme
You are viewing a single comment's thread. Return to all comments →