Initial commit

This commit is contained in:
2022-01-08 20:48:32 +01:00
commit aecb16fe01
61 changed files with 788 additions and 0 deletions

15
sidan_185_ex1.py Normal file
View File

@@ -0,0 +1,15 @@
#!/usr/bin/env python3
import math
try:
t = int(input("Ange täljaren: "))
n = int(input("Ange nämnaren: "))
except ValueError:
exit("Ange endast heltal")
sgd = math.gcd(t, n)
print ("SGD är:", str(sgd))
print (str(t) + "/" + str(n), "=", \
str(int(t/sgd)) + "/" + str(int(n/sgd)))