n=int(input())
l=[]
vow=['a','e','i','o','u']
for i in range(n):
l.append(input())
pre=[]
for j in range(n):
for i in range(len(l[i])):
if(l[i][j] in vow):
pre.append(l[i])
pre=list(set(pre))
if(len(pre)==len(l)):
print("no values")
else:
for i in range(n):
if(l[i] in pre):
pass
else:
print(l[i])
Q2. Given passenger ID name gender distance In last two lines they provide the passenger ID and discount percentage We need to print the discount to be given for that particular passenger if that given Id is not in the list print no name or no value
Input :
4
101
a
f
10000
102
b
m
12000
103
c
f
45000
104
d
m
65000
101
5
Solution:
class Passenger:
def __init__(self,pid,pname,pgender,pmiles):
self.pid=pid
self.pname=pname
self.pgender=pgender
self.pmiles=pmiles
def calculate_discount(self,pid,discount_rate):
for i in pass_list:
if i.pid==pid:
discount=(i.pmiles*discount_rate)/100
return discount
class Organisation(Passenger):
def __init__(self,oname,pass_list):
self.oname=oname
self.pass_list=pass_list
if __name__ == '__main__':
n=int(input())
pass_list=[]
for i in range(n):
pid=input()
pname=input()
pgender=input()
pmiles=int(input())
pass_list.append(Passenger(pid,pname,pgender,pmiles))
pid=input()
discount_rate=int(input())
o=Organisation('TCS',pass_list)
discount=o.calculate_discount(pid,discount_rate)
if discount<0:
print("Passenger not eligible for discount")
else:
print("The discount of passenger "+pid+" is " +str(discount))