0
How to factor a number?
n! or ! n
Example:
Let’s take x = 5
x = input('Digite um número inteiro: ')
i = 1
while i <= x:
for i in range(x):
i = i + 1
a = []
a.append(i)
print(a)
break
Since the result should be 120, however the interpreter prints this:
[1]
[2]
[3]
[4]
[5]
With append I was able to print 'i' from 1 to 'x'. In the example above, 'i = 1' and 'x = 5'. What I can’t do is multiply 'i' from 1 to 'x'!
In many ways. How you tried to do and what was the difficulty found?
– Woss
Welcome, consider visiting the links reported above. If you are trying to become a programmer, it is not a good help to respond with a ready algorithm, right here on the site there are already a lot of answers. https://answall.com/search?q=fatorial+python but in this way you would be helped not to be a programmer. Try to write a code, represented the problem, step by step, and [Edit] your question by putting the difficulty you find.
– MagicHat
Have you researched in these questions?
– Woss