how to print a char of element in list in pyhton

Solutions on MaxInterview for how to print a char of element in list in pyhton by the best coders in the world

showing results for - "how to print a char of element in list in pyhton"
Maceo
07 Feb 2016
1#declaring list
2myList=[12,'Hello','World!']
3#for strings
4print(myList[1][2]) # output --> l
5#for numbers
6temp=str(myList[0])
7print(temp[1]) # output --> 2