This repository has been archived on 2025-12-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
2024-09-20 14:17:13 +03:00

14 lines
355 B
Python

def checkAgeEntry(filename):
f1 = open(filename)
for age in f1:
try:
a = age.strip().split(":")
y = int(a[1])
except ValueError:
print ("age entry is not correct",a[0],a[1])
else:
print ("age entry is correct",a[0],a[1])
#main program
checkAgeEntry("person.txt")