Exception Handling & Generate Functions

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

Answer

def AFIND(CITIES):
	for i in CITIES:
		if i[0]=='A':
			print i

Sponsor Area

Some More Questions From Exception Handling & Generate Functions Chapter