I am trying to compute the factorial of n using for loop and an accumulator. I am having trouble with the range command and its two parameters - start and end. I am getting invalid syntax error. Here's the code:
# factorial.py
# Program to compute the factorial of a number
# Illustrates for loop with an accumulator
def main():
n = int(input("Please enter a whole number: "))
fact = 1
for factor in range(1, (n + 1))
fact = fact * factor
print("The factorial of", n, "is", fact)
main()
Where's the problem?
I am using Python 3.6.