+ 8
What is the output of this code? print(str[0]) if str='Hello World'
2 Answers
- 1
It will print H because H is the first in the string array, str[1] is e, str[2] is l, and so on.
+ 1
you should use str_ or something entirely different as variable instead since its a type nominator. and end with : . if str_ would be "Hello World" then it would print H from str_ string.
check docs about slicing for more info