commit 98d77e68cfd8971641558e2e67d6e61f97e023e5 Author: Martin J. Klöckner <martin.cachari@gmail.com> Date: Tue, 27 Oct 2020 08:26:51 -0300 Testing python Diffstat:
A | factorial.py | | | 10 | ++++++++++ |
A | helloworld.py | | | 1 | + |
2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/factorial.py b/factorial.py @@ -0,0 +1,10 @@ +fact = int(input("Ingrese un numero: ")) +res = 1 + +if fact < 0: + print('Numero invalido') + +else: + for i in range(fact): + res += res * i + print(str(fact) + '! = ' + str(res)) diff --git a/helloworld.py b/helloworld.py @@ -0,0 +1 @@ +print("Hello world!")