0
Help interpreting output of this code!
How did we get to this output? Any help is very much appreciated! Input: a = 1 B = a + 1 print(B, end= ââ) print(B,a,sep= â0â) Output: 2201
4 Answers
+ 2
exactly. end="" skips next line and the next print function remains on the same line.
+ 4
first it prints B which is 2 because A is 1 and A+1 is 2..
Then end="" introduces a string, so instead of adding B+B which is 4, it adds "B" + "B" which is "22" as a string
Then it adds a to it which is 1, and separates them with a "0"
+ 1
Thanks! But so does the end=ââ get rid of the new line after the first print function as to concatenate it with the output of the second print function?
+ 1
Youâre the best! Thank you so much