0
Can anyone explain i m little confused
14 Respostas
+ 9
https://www.sololearn.com/Discuss/2760507/?ref=app
Akash Prasad ,
Please, avoid asking duplicate questions again & again.
You already got explanation from Jan Markus very well.
+ 8
Rohit well done đ đđđ
+ 8
Rohit
There was nothing about IQ here.
Well, whatever đ thanks for clarification. I am not in favor of spammers or spamming đ so, just politely asked you to give credits.
That was rude!
+ 7
Well, if I don't understand then.. explain in the same thread/question what are you expecting.
So, in that context anyone can help you. But, avoid asking same questions again.
+ 7
Rohit ,
Please give credits to Jan Markus , as he is the one who helped in previous thread
+ 5
Rohit
No problem :)
+ 3
lis=["jai","maa","bharati"]
name="slog:{2},{1},{1}".format(lis[0],lis[0],lis[2])
print(name)
Explanation: Akash Prasad
lis[0] = "jai"
lis[1] = "maa"
lis[2] = "bharati"
So this thing:
name="slog:{2},{1},{1}".format(lis[0],lis[0],lis[2])
BECOMES
name="slog:{2},{1},{1}".format("jai", "jai", "bharati")
Here:
format("jai", "jai", "bharati")
{0} = "jai"
{1} = "jai"
{2} = "bharati"
Therefore, after plugging the strings in its correct index position, we have our final output as:
slog:bharati, jai, jai
+ 2
PLEASE DON'T SPAM BY ASKING THE SAME QUESTION MANY TIMES.
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
+ 2
Shivani đâ
All credits goes to Jan Markus
ALL CREDITS GOES TO JAN MARKUS
AlL cReDiTs GoEs To Jan Markus
Are those enough?!!
all credits goes to Jan Markus
+ 1
Shivani đâ sorry!!
edited my answer!
(I was mad because the same question was being asked many times)
0
You are not understanding what I am saying after changing indexing
0
#corrected
list=["jai","maa","bharati"]
name="slog: {0},{1},{2}".format(list[0],list[1],list[2])
print(name)
0
Shivani đâ I never mentioned/said that those answers were mine, anyone with an IQ of 150(edited) or above would easily know my intention here, that I was just spamming the already spammed question with the answers I got from the post that you linked here as your answer. And I didn't even check whose answers it were. And thank you for letting me know, thanks Jan Markus!
Anyway, I'm sorry for not giving proper credits. Now that Im done crediting, I'm unfollowing this thread.
Happy learning and thanks!
0
L