Lagt till kapitel 8
This commit is contained in:
11
kapitel8/while-true-ex2.py
Normal file
11
kapitel8/while-true-ex2.py
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
while True:
|
||||
try:
|
||||
tal = int(input("Skriv ett heltal: "))
|
||||
except:
|
||||
print("Skriv endast heltal")
|
||||
else:
|
||||
print("Du skrev", tal)
|
||||
break
|
||||
|
Reference in New Issue
Block a user