Practice The String Type In Python (6.2.2) - Strings - Part A - Data Structures and Algorithms in Python
Students

Academic Programs

AI-powered learning for grades 8-12, aligned with major curricula

Professional

Professional Courses

Industry-relevant training in Business, Technology, and Design

Games

Interactive Games

Fun games to boost memory, math, typing, and English skills

The String Type in Python

Practice - The String Type in Python

Learning

Practice Questions

Test your understanding with targeted questions

Question 1 Easy

What is the output of 'Python' + 'Programming'?

💡 Hint: Think about how strings are combined.

Question 2 Easy

What does s[1] return for s = 'Programming'?

💡 Hint: Recall that indexing starts at 0.

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

Question 1

What is a string in Python?

A type of number
A collection of characters
A boolean value

💡 Hint: Think about the definition of a string.

Question 2

True or False: In Python, the first character of a string has an index of 1.

True
False

💡 Hint: Recall how indexing works.

1 more question available

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

You have a string variable msg = 'Happy coding!'. Write Python code to extract 'coding' from this string using indexing.

💡 Hint: Think about how slicing works in Python strings.

Challenge 2 Hard

You need to create a greeting message stored in a variable called greeting that combines your name with 'Welcome to Python, 'You should end up with 'Welcome to Python, [your name]'.

💡 Hint: Use concatenation to achieve this.

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.