Answers for "how to print char of element in list of pytohn"

5

how to print char of element in list of pytohn

#declaring list
myList=[12,'Hello','World!']
#for strings
print(myList[1][2]) # output --> l
#for numbers
temp=str(myList[0])
print(temp[1]) # output --> 2
Posted by: Guest on September-15-2020
0

how to join an array of characters in python

arrayOfCharacters = ["p", "y", "t", "h", "o", "n"]
string = ''.join(arrayOfCharacters)
#output: python
Posted by: Guest on May-07-2020

Code answers related to "how to print char of element in list of pytohn"

Python Answers by Framework

Browse Popular Code Answers by Language