String formatting | Sololearn: Learn to code for FREE!


String formatting

What's wrong

4/20/2021 2:36:14 PM

Akash Prasad

6 Answers

New Answer


your version was: list=["jai","maa","bharati"] name="slog:"{0},{1},{2}.formate(list[0],list[1],list[2]) print(name) 1.) The closing quotation mark what you have after slog: has to be positioned after {2} 2.) the "format" keyword has to be written without the "e" at the end 3.) you should not name a list "list", because "list" is a reaerved keyword in Python. it is used to create a list from an iterable


#corrected list=["jai","maa","bharati"] name="slog: {0},{1},{2}".format(list[0],list[1],list[2]) print(name)


Can you please point out my mistake


Thanks bro


Yoo what the hell you can comment on stuff


Please help me to learn coding