Level 03: condition controlled repetitions 0 of 9 activities solved
  1. 1. Capital city Not yet solved
  2. 2. Car value Not yet solved
  3. 3. Adder Not yet solved
  4. 4. Compound interest Not yet solved
  5. 5. Valid month Not yet solved
  6. 6. Cashpoint Not yet solved
  7. 7. Square root Not yet solved
  8. 8. PIN Not yet solved
  9. 9. Measurements Not yet solved
Next series Assessment point: levels 01-03
Level 03: condition controlled repetitions

1. Capital city

Sign in to hand in your solution and get feedback.

# 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.")