Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # number to find the factorial of
- number = 6
- # start with our product equal to one
- product = 1
- # track the current number being multiplied
- current = 1
- # write your while loop here
- while current != number+1:
- # multiply the product so far by the current number
- product = product * current
- # increment current with each iteration until it reaches number
- current += 1
- # print the factorial of the number
- print(product)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement