Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What character is at index 2 in the string 'Python'?
Consider the third position in the string.
Use slicing to retrieve 'Pro' from 'Programming'. What is the code?
You can use the start index to slice.
What is the output of text[-1] if text = 'Hello'?
Think about counting from the end of the string.
Using slicing, what will text[1:5] return in the string 'Python'?
Identify the start and stop indices.
Given the string 'Artificial', how would you use slicing to get the substring 'ific'?
Identify the starting and stopping point.
Using a given string, how to retrieve character 'e' from 'Programming'?
Count from zero for indices.
5 more questions in this section. Enroll free to practise them all.
Enroll free