0
Python (access element in list and print with string)
hi=[21,23,24,25] print ("list contains"+str(*hi,sep=" , ") The above code is correct to print elements in list with string and with out square bracket I need output like O/p : List contains 21,23,24,25 Please help
4 Answers
+ 4
hi=[21,23,24,25]
print (','.join([str(x) for x in hi]))
0
I want to print it with some string
0
I think you meant this
https://code.sololearn.com/cgK6n0oJ3JiI/?ref=app