Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to print a char of element in list in pyhton

#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
Comment

PREVIOUS NEXT
Code Example
Python :: pprint python 
Python :: upload file in colab 
Python :: how to sum the revenue from every day in a dataframe python 
Python :: python exit button 
Python :: how to append rows to a numpy matrix 
Python :: how to count stopwords in df 
Python :: python convert latitude longitude to x y 
Python :: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead. 
Python :: python pie chart with legend 
Python :: python year from date 
Python :: python nltk tokenize 
Python :: load saved model pyspark 
Python :: matplotlib x axis at the top 
Python :: add favicon fastapi 
Python :: update python 3.10 ubuntu 
Python :: how to clear the console python 
Python :: how to unzip files using zipfile module python 
Python :: how to get a list of followers on instagram python 
Python :: debug flask powershel 
Python :: how to dynamically access class properties in python 
Python :: csv from string python 
Python :: adjust tick label size matplotlib 
Python :: creating an interface tkinter 
Python :: check column type pandas 
Python :: python plot cut off when saving figure 
Python :: f string float format 
Python :: delete files inside folder python 
Python :: format numbers in dataframe pandas 
Python :: pandas dataframe hist title 
Python :: bail bond cowboys 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =