Börjat lägga till kodexempel
This commit is contained in:
14
kapitel7/match-ex3.py
Normal file
14
kapitel7/match-ex3.py
Normal file
@@ -0,0 +1,14 @@
|
||||
namn = "Tjatte"
|
||||
|
||||
match namn:
|
||||
case "Joakim":
|
||||
print("Rik farbror")
|
||||
case "Kalle":
|
||||
print("Snäll anka")
|
||||
case "Knatte" | "Fnatte" | "Tjatte":
|
||||
print("En av Knattarna. Har olikfärgade mössor")
|
||||
case "Kajsa":
|
||||
print("Kalles flickvän")
|
||||
case _:
|
||||
print("Någon annan karaktär")
|
||||
|
Reference in New Issue
Block a user