New: Intelligent Flashcards spaced-repetition decks for every topic, built to make things actually stick.
For the string s = "hello", what does s[0] return?
s = "hello"
s[0]
An IndexError, because indexing requires a positional bracket notation like s.0
IndexError
s.0
"h", because Python sequences are zero-indexed and s[0] is the first element
"h"
"e", because Python indexing starts counting from 1
"e"
1