Practice - Accessing Characters by Position
Practice Questions
Test your understanding with targeted questions
What is the index of the character 'r' in the string 'Python'?
💡 Hint: Count from 0.
Using the string 'hello', what character is at index 1?
💡 Hint: Think about the first character.
4 more questions available
Interactive Quizzes
Quick quizzes to reinforce your learning
What is indexing in Python?
💡 Hint: It starts from zero.
In Python, what will s[-2] return if s = 'hello'?
💡 Hint: Count backwards from 'o'.
2 more questions available
Challenge Problems
Push your limits with advanced challenges
Given the string text = 'understanding', write code that returns the substring from index 2 to -3.
💡 Hint: Think about how to extract using both positive and negative indices.
Concatenate the strings greet = 'Hello' and name = 'Alice' such that it outputs 'Hello, Alice!'. Write the code to achieve this.
💡 Hint: Remember to include spaces and punctuation when joining.
Get performance evaluation
Reference links
Supplementary resources to enhance your learning experience.