Practice Lecture - 04 (29.1.5) - String functions - 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

Lecture - 04

Practice - Lecture - 04

Learning

Practice Questions

Test your understanding with targeted questions

Question 1 Easy

What is the output of print('Python'[1])?

💡 Hint: Think about string indexing.

Question 2 Easy

Use split() on 'hello world' to create a list. What will the list contain?

💡 Hint: What do you expect it to break up on?

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

Question 1

What is the output of print('Hello'[1])?

H
e
l
o

💡 Hint: Think about the position of letters in the string.

Question 2

Escape characters are used for what purpose?

True
False

💡 Hint: Think of special characters in strings.

2 more questions available

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

Create a function that takes a string and a character, then returns how many times the character appears in the string.

💡 Hint: Consider a string method that counts occurrences.

Challenge 2 Hard

Write a program that asks for user input and prints it reversed without using the reverse() method.

💡 Hint: Think about indexing and slicing in reverse.

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.