Computer Science, asked by tia737, 6 months ago

write a python write a program to input a list names of persons and then print all such names which begins with letter a and ends with letter n
Chapter: List Manipulation ​

Answers

Answered by allysia
12

It goes like:

#making list

a=int(input ("Enter the list length: "))

lis=[]

for  i  in  range (0,a):

          b=input("Enter  the name: ")

          lis.append(b)

#printing from list as per condition

for j in  lis:

    if  (j[0]=="a" ) and j[-1]=="n":

          print(j)

If you're having trouble understanding the latex consider the attachment,

Attachments:
Similar questions