I am supposed to:
- Write the program to input the list of names of students. Display names of those students whose names end with the letter 'A'
so I have written the below code:
input_variable =input('Enter Your list : ')
list1=eval(input_variable)
i=0
while i<len(list1):
a=list[i]
if a[-1]=="a":
print (list1[i])
I am getting the below error:
Traceback (most recent call last):
File "main.py", line 5 in <module>
a=list[i]
Type error: 'type' object is not subscribable