> Write a python program that calculates factorial of a number integar using simple while loop?

Write a python program that calculates factorial of a number integar using simple while loop?

Posted at: 2014-12-18 
!/usr/bin/python

def fact(number):

.... factorial = 1

.... while number>=1:

.... .... factorial *= number

.... .... number -= 1

.... return factorial

def main():

.... number = int(input("Enter a number: "))

.... print("{}! = {}".format(number,fact(number)))

main()

# Note: I've used "...." to indicate tab characters, which Yahoo! Answers removes.

Translate this Java code:

fact = 1;

for (int i=2; i<=n; i++) fact *= i;

factorial = 1;

while (number>=1) {

factorial *= number;

number--;

}