12 lines
255 B
Python
12 lines
255 B
Python
class DriverException(Exception):
|
|
pass
|
|
|
|
|
|
people = [('James', 17), ('Kirk', 9), ('Lars', 13), ('Robert', 8)]
|
|
for person, age in people:
|
|
if age >= 18:
|
|
driver = (person, age)
|
|
break
|
|
else:
|
|
raise DriverException('Driver not found.')
|