-
Notifications
You must be signed in to change notification settings - Fork 0
/
participant.py
56 lines (33 loc) · 1.13 KB
/
participant.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# # collecting and writing tourist data to an external file
# touristData = []
# touristCounter = 0
# max = 2
# while touristCounter < max:
# temp = []
# name = input(f"Name :{str(touristCounter)}\n")
# temp.append(name)
# dob = input(f"D.O.B :{str(touristCounter)}\n")
# temp.append(dob)
# nat = input(f"Nationality :{str(touristCounter)}\n")
# temp.append(nat)
# ppn = input(f"Passport Number :{str(touristCounter)}\n")
# temp.append(ppn)
# ppExp = input(f"Passport Expiry Date :{str(touristCounter)}\n")
# temp.append(ppExp)
# occ = input(f"Occupation :{str(touristCounter)}\n")
# temp.append(occ)
# touristData.append(temp)
# touristCounter += 1
# with open("tourist.txt","w") as tourist:
# for tdata in touristData:
# for data in tdata:
# tourist.write(data+",")
# tourist.write("\n")
age = {}
dob = []
with open("tourist.txt","r") as data:
for line in data:
temp = line.strip("\n").rstrip(",").split(",")
dob.append(temp[1])
age = set(dob)
print(age)