File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 1+ #EN- Loop structure: While
2+ #Factorial Calculation
13#60- Write a program that reads any number and displays its factorial.
24# just in four lines
35'''from math import factorial
68print(f'The factorial of {number}! is {result}')'''
79
810# or you can make it prettier
9- number = int (input ('Enter a number:' ))
11+ ''' number = int(input('Enter a number:'))
1012counter = number
1113fat = 1
1214print(f'Calculating {number}! =', end= ' ')
1517 print(' x ' if counter > 1 else ' = ', end=' ')
1618 fat *= counter
1719 counter -= 1
18- print (f'{ fat } .' )
20+ print(f'{fat}.')'''
21+
22+ #PT- Estrutura de repetição: While
23+ #Cálculo do Fatorial
24+ #60: Faça um programa que leia um número qualquer e mostre o seu fatorial. Exemplo:
25+ from math import factorial
26+ numero = int (input ("Digite um número:" ))
27+ print (f'O fatorial de { numero } é { factorial (numero )} .' )
You can’t perform that action at this time.
0 commit comments