+ 2

What does that this function signifies?...Can you please make me understand?

print ("{0}{1}{0}".format('abra','cad'))

15th May 2020, 7:34 AM
Bhanu Tripathi
Bhanu Tripathi - avatar
5 odpowiedzi
+ 2
Its replacing the placeholders {...}. {0} = first item {1} = second item So "abra" + "cad" + "abra"
15th May 2020, 7:47 AM
Manu_1-9-8-5
Manu_1-9-8-5 - avatar
+ 3
{0} equals first argument passed into the format function {1} equals second argument passed into the format function {2} equals third argument passed into the format function And so on... So output would be abracadabra It's also the same as: print(f"{'abra'}{'cad'}{'abra'}")
15th May 2020, 7:50 AM
ChaoticDawg
ChaoticDawg - avatar
+ 3
{0}{1}{0}={abra}{cad}{abra}
15th May 2020, 8:36 AM
💡Arno Gevorgyan 🐍
💡Arno Gevorgyan 🐍 - avatar
0
What??
15th May 2020, 2:30 PM
Bhanu Tripathi
Bhanu Tripathi - avatar