Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def print_list(soort, lijst):
- print(f"Verzameling {soort}:")
- for getal in lijst:
- print(f"{getal} zit op positie {lijst.index(getal)}")
- lijst1 = [12, 45, -9, -15]
- lijst2 = [12.23, 45.1, 9.478, 15.125, -3.14]
- lijst3 = ["Dieter","Christophe", "Stijn"]
- print_list('gehele getallen', lijst1)
- print_list('komma getallen', lijst2)
- print_list('strings', lijst3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement