Python Question / Quiz; What is the output of the following Python code, and why? Comment your answers below!

PythonPr's tweet image. Python Question / Quiz; What is the output of the following Python code, and why? Comment your answers below!

The output is 55. Since both variables are strings, the + operator performs concatenation, not arithmetic addition. In Python, "5" + "5" simply joins the two strings together, resulting in "55"


Stream, call, game, and work in even the most remote locations. Order online in minutes


The output of print(a+b) will be 55. This is because the variables a and b are defined as strings due to the quotes surrounding the numbers. When you use the + operator on two strings in Python, it performs string concatenation, which means


The answer is B. 55. Mathematical operation cannot be performed on string data type, therefore the plus operator would concatenate the stings. So that makes the answer 55


Additions of strings will lead to concatenation, so B.


B. 55 because both a and b are texts


guys you could be teaching some useful stuff here smh


Answer:-(B)55 a and b are two strings here so when you use + operator here then python performs string concatenation.


The answer is 55 😄 Because both a and b are strings, not numbers, so Python doesn’t add them , it just sticks them together. So writing "5" + "5" will print "55", same way "tea" + "cup" gives "teacup". So simple when you get it 😉


B, string concatenation


Enterprise grade phone system from 3CX. Cut licensing costs by 80% with no per user pricing. Easy set up, DIY admin, cut call costs and choose where to host. 3CX is the PBX of choice for 350,000 installs and counting.


Optioj b it is string so string get added together so 55


I need this in my life! shop now: kleinita.com/products/clean…


concatenating strings? This is your gotcha?


B) 55 Because of concatenation of string


B. 55 because is a concatenating two strings


The output print will be "55"


United States 趨勢
Loading...

Something went wrong.


Something went wrong.