Begynder done. /JL
This commit is contained in:
6
begynder/main.py
Normal file
6
begynder/main.py
Normal file
@@ -0,0 +1,6 @@
|
||||
MIN_VARIABEL = "Hej med dig!"
|
||||
|
||||
def udskriv_variabel(var):
|
||||
print(var)
|
||||
|
||||
udskriv_variabel(MIN_VARIABEL)
|
6
begynder/sum.py
Normal file
6
begynder/sum.py
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
def sum(tal1, tal2):
|
||||
return str(f"Resultat {tal1} + {tal2}: {tal1 + tal2}")
|
||||
|
||||
resultat = sum(5, 3)
|
||||
print(resultat)
|
10
begynder/sum2.py
Normal file
10
begynder/sum2.py
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
def sum(tal1, tal2):
|
||||
# return str(f"Resultat {tal1} + {tal2}: {tal1 + tal2}")
|
||||
return str(f"Resultat {tal1} + {tal2}: {int(tal1) + int(tal2)}")
|
||||
|
||||
tal1 = input("Indtast tal1:")
|
||||
tal2 = input("Indtast tal2:")
|
||||
|
||||
resultat = sum(tal1, tal2)
|
||||
print(resultat)
|
Binary file not shown.
Before Width: | Height: | Size: 104 KiB |
Reference in New Issue
Block a user