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. Texans 25.9K posts
- 2. #MissUniverse 80.2K posts
- 3. Josh Allen 11.1K posts
- 4. Davis Mills 2,289 posts
- 5. James Cook 4,410 posts
- 6. Christian Kirk 2,705 posts
- 7. #TNFonPrime 1,533 posts
- 8. Taron Johnson N/A
- 9. Sedition 236K posts
- 10. Will Anderson 2,914 posts
- 11. Shakir 3,414 posts
- 12. Woody Marks 2,302 posts
- 13. Nico Collins 1,243 posts
- 14. Prater N/A
- 15. #BUFvsHOU 1,711 posts
- 16. Treason 126K posts
- 17. #htownmade 1,419 posts
- 18. Lamelo 9,490 posts
- 19. Nick Caley N/A
- 20. Seditious 133K posts
Something went wrong.
Something went wrong.