0
What would be the result of the following code: '{0}{1}{0}'.format(1, 0)?
0. '010' 1. '100' 2. '101' 3. '01{0}'
5 Answers
+ 3
you can ask why the output would be this and then we can maybe discuss it but asking for the output doesn't really make sense, you can try executing the code to get the result
+ 2
You can also try it yourself.
If you want, you can ask the question that "How the output of this code is ....."
So, let me tell you hints:
The output will be " 101"(According to me)
because inside format, 1 and 0 are given and the indexing values for replacing are 0,1,0.
In the place of 0 index,1 is given and in the place of index 1 index,0 is given and in the place of index 0, 1 is again given
Edit: Yeah, I was right. I just checked up in the code playground.
+ 1
pop it in the playground and see!
+ 1
101
Do you want to know the reason?
0
What is this ?
1.100.
Here MCQ .