+ 2
How to convert all objects(elements) of list to str
Hi, i want to print catalogues: catalogue = 'history' index = list(range(1,21) def print_catalogues(summ): print(catalog + index) print_catalogues(summ) I need convert list to str(). How do it right?
4 Answers
+ 1
catalogue = 'history'
index = list(range(1,21)
def print_catalogues(summ):
print(catalog + str(index))
print_catalogues(summ)
#covert to string by
str(_____)
0
Vishnu, thanks for your answer. I must test your code on my PC;)
0
there are IFs like
int() #int of
str() #string of etc...
chr()
float()
any thing can be converted to string for others it may not happen
int('hello')
will return a value error
0
maybe it not possible with list(range(1,21))?