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

8/17/2019 2:08:00 AM

ASHARAF K

4 Answers

New Answer

+4

hi=[21,23,24,25] print (','.join([str(x) for x in hi]))

+2

Try this https://code.sololearn.com/ceGvpydREgfN/?ref=app

0

I want to print it with some string

0

I think you meant this https://code.sololearn.com/cgK6n0oJ3JiI/?ref=app