+ 1

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

Can anyone please explain this code

19th Jan 2021, 11:09 AM
Reuben
1 Answer
+ 10
"abra" is the index of 0, "cad" is the index of 1. So, {0}{1}{0} will be abracadabra.
19th Jan 2021, 11:25 AM
Simba
Simba - avatar