Question
Write the definition of a Method AFIND(CITIES) to display all the city names from a list of CITIES, which are starting with alphabet A.
For example:
If the list CITIES contains ['AHMEDABAD','CHENNAI','NEW DELHI','AMRITSAR','AGRA']
The following should get displayed
AHMEDABAD
AMRITSAR
AGRA
Solution
def AFIND(CITIES):
for i in CITIES:
if i[0]=='A':
print i