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

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…

C The reason is that [-1] tells split to start at the end 'g' and go back to the first occurence of a space `" "`.


C- programming


Option (c) programming


c


C is the correct answer 😃


C) Programming


The string starts with a space, so when we split it by " ", we get ['', 'Python', 'Programming'] — the last element (-1) is 'Programming', which is why the output is Programming.


United States Trends
Loading...

Something went wrong.


Something went wrong.