From 69f2366b3c7b25103ccba02b805adb6abc069c1c Mon Sep 17 00:00:00 2001 From: krishna120801 Date: Sat, 30 Oct 2021 02:24:03 +0530 Subject: [PATCH] two answers of questions are added --- bintodec.py | 2 ++ factorial.py | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 bintodec.py create mode 100644 factorial.py diff --git a/bintodec.py b/bintodec.py new file mode 100644 index 0000000..45f04ec --- /dev/null +++ b/bintodec.py @@ -0,0 +1,2 @@ +n=int(input()) +print(bin(n).replace("0b",""))#for int input diff --git a/factorial.py b/factorial.py new file mode 100644 index 0000000..3325500 --- /dev/null +++ b/factorial.py @@ -0,0 +1,18 @@ + +import math +import os +import random +import re +import sys + +# Complete the extraLongFactorials function below. +def extraLongFactorials(n): + fact=1 + for i in range(1,n+1): + fact*=i + print(fact) + +if __name__ == '__main__': + n = int(input()) + + extraLongFactorials(n)