Level 03: condition controlled repetitions 0 van 9 activiteiten opgelost
  1. 1. Capital city Nog niet opgelost
  2. 2. Car value Nog niet opgelost
  3. 3. Adder Nog niet opgelost
  4. 4. Compound interest Nog niet opgelost
  5. 5. Valid month Nog niet opgelost
  6. 6. Cashpoint Nog niet opgelost
  7. 7. Square root Nog niet opgelost
  8. 8. PIN Nog niet opgelost
  9. 9. Measurements Nog niet opgelost
Volgende reeks Assessment point: levels 01-03
Level 03: condition controlled repetitions

1. Capital city

Meld je aan om je oplossing in te dienen en feedback te krijgen.

# Capital city program # ------------------------- # Subprograms # ------------------------- def check_answer(country, city): if country == "England" and city == "London": return True if country == "France" and city == "Paris": return True else: return False def capital_cities(): correct = False while not correct: city = input("What is the capital city of England? : ") correct = check_answer("England", city) correct = False while not correct: city = input("What is the capital city of France? : ") correct = check_answer("France", city) # ------------------------- # Main program # ------------------------- capital_cities() print("The quiz is complete.")