Practice Strings (6.1.1) - 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

Strings

Practice - Strings

Learning

Practice Questions

Test your understanding with targeted questions

Question 1 Easy

Define a string variable called food with the value 'Pizza'. What is the output of print(food)?

💡 Hint: Remember to enclose your value in quotes.

Question 2 Easy

What is the first character of the string name = 'Alice'?

💡 Hint: Use the index 0 to find the first character.

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

Question 1

What symbol is used for concatenation in Python?

*
+
&

💡 Hint: It's the same symbol you use for addition.

Question 2

True or False? In Python, a character is different from a string of length one.

True
False

💡 Hint: Think about how Python defines types.

2 more questions available

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

Create a Python script that asks the user for their first name and last name, and then prints them concatenated in the format 'Last, First'.

💡 Hint: Break it down: Gather input, format the print statement.

Challenge 2 Hard

Write a function that counts the number of characters in a given string and prints both the string and the character count.

💡 Hint: Think about using the `len()` function for character counting.

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.