Python Question / Quiz; What is the output of the following Python code, and why? Comment your answers below! #python #programming #developer #programmer #coding #coder #softwaredeveloper #computerscience #webdev #webdeveloper #webdevelopment #pythonprogramming #pythonquiz #ai

Python_Dv's tweet image. Python Question / Quiz;

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

#python #programming #developer #programmer #coding #coder #softwaredeveloper #computerscience #webdev #webdeveloper #webdevelopment #pythonprogramming #pythonquiz #ai…

bye a = "hello"+"world" = helloworld, there is no space between hello and world.


The output is bye and the reason is that a produces 'helloworld' no white spaces between hello and world which is different from 'hello world' so since both are different it prints the else condition


B) bye. Because a is helloworld not hello world


B is the answer: a != "hello world" a == "helloworld" It's a tricky question. I had to critically look into it.


B because there isn’t a space in the quotes. A would equal helloworld.


Bye. Reason because there's no space when hello and world are concatenated together


You are right, i make a lot of mistakes in spaces... B is correct answer


bye because "helloworld" is not equal "hello world"


There is no space in the first line of code, but your program is looking for two words with a space between them. So the answer is Bye.


'bye' will be the output!


B) Bye "hello" + "world" == "helloworld" not "hello world", so else is triggered.


此推文已無法使用。

Bye, As the string a is equals to "helloworld" which is not same as "hello world" hence it will execute the else part which is bye.


Either b) or it tells you to use "is" as comparator.


Answer is B


Esay. B. There are no spaces in either string.


United States 趨勢
Loading...

Something went wrong.


Something went wrong.