Advertisements
Advertisements
Question
Predict the output of the following Python code:
wildlife_sanctuary = ["Kaziranga", "Ranthambhore", "Jim Corbett", "Sundarbans",
"Periyar", "Gir", "Bandipur"]
output = [ ]
for sanctuary in wildlife_sanctuary:
if sanctuary[−1] in 'aeiou':
output.append(sanctuary[0].upper())
print(output)Very Short Answer
Advertisements
Solution
['K', 'R']
shaalaa.com
Is there an error in this question or solution?
