0 like 0 dislike
Python code below :
in Service-based-companies by Expert (17,730 points) | 2,090 views

1 Answer

0 like 0 dislike
class Citizen:
  def __init__(self,citizenid,citizenname,citizenage,isfrontlineworker,vaccineoptedfor):
  def setpreference(l):
    return 1 if l.workertype.lower()=="yes" or l.age>45 else 0
class vaccinationDrive:
  def __init__(self,citizen):
  def getpreferredvaccinationcount(self):
    for i in self.clist:
     if Citizen.setpreference(i):
    return count if count else "preferred citizen not found"
  def getcitizensaspervaccine(self,vaccinename):
    for i in self.clist:
      if i.vaccine==vaccinename:
    if l:
      l=sorted(l,key=lambda l:l.age)
    return l if l else "Citizen not found"
if __name__=='__main__':
  for i in range(n):
  print(ans) if "not" in ans else [print(str(i.id)+'\n'+i.name+'\n'+str(i.age)) for i in ans]
by Expert (17,730 points)

Get best answers to any doubt/query/question related to programming , jobs, gate, internships and tech-companies. Feel free to ask a question and you will receive the best advice/suggestion related to anything you ask about software-engineering , development and programming problems .