Practice - Character Positions in Strings
Practice Questions
Test your understanding with targeted questions
What is the index of the first character in the string 'Python'?
💡 Hint: Indexes start from zero.
What character does string[3] refer to in 'Python'?
💡 Hint: Count from zero: P=0, y=1, t=2, h=3.
4 more questions available
Interactive Quizzes
Quick quizzes to reinforce your learning
What is the output of the following code: print('hello'[1])?
💡 Hint: Count the characters starting from zero.
Can strings in Python be concatenated using the + operator?
💡 Hint: Consider how you would combine two words.
2 more questions available
Challenge Problems
Push your limits with advanced challenges
Write a function that takes a string as input and returns the first and last character concatenated together.
💡 Hint: Use positive and negative indexing.
Create a string containing your five favorite words and return the middle word based on string length.
💡 Hint: Find the center based on words.
Get performance evaluation
Reference links
Supplementary resources to enhance your learning experience.