This commit is contained in:
adii1823
2021-10-28 17:34:45 +05:30
parent 583ec6a898
commit 8b802c5c62
34 changed files with 332 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
class DriverException(Exception):
pass
people = [('James', 17), ('Kirk', 9), ('Lars', 13), ('Robert', 8)]
driver = None
for person, age in people:
if age >= 18:
driver = (person, age)
break
if driver is None:
raise DriverException('Driver not found.')