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 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
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.
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.
United States 趨勢
- 1. #UFCQatar 58.7K posts
- 2. Harden 18.6K posts
- 3. Belal 8,169 posts
- 4. Arman 14.6K posts
- 5. Mizzou 5,335 posts
- 6. Garry 13.3K posts
- 7. Dan Hooker 4,421 posts
- 8. Arbuckle 1,602 posts
- 9. Mercer 2,357 posts
- 10. Rutgers 6,250 posts
- 11. Liverpool 199K posts
- 12. Deuce Knight 1,149 posts
- 13. #RiyadhSeason 1,950 posts
- 14. Newcastle 56.3K posts
- 15. Mateer 2,460 posts
- 16. Missouri 11.5K posts
- 17. Malachi Toney N/A
- 18. Syracuse 3,191 posts
- 19. #Sooners 1,869 posts
- 20. Talty N/A
Something went wrong.
Something went wrong.