Help
Contact
For teachers and institutes
Search courses, problems, tests…
A
A
>_
StemPy Lab
Courses ▾
Problems ▾
Practice ▾
Mock Tests
Classes
Groups
Community ▾
A
A
Problems
/
Python Basics
/
Strings
Strings
Python Programming
+ Upload a Problem
More in Python Basics
Getting Started with Python
Variables and Data Types
Operators and Expressions
Input and Output
Strings
Conditionals: if, elif, else
Loops
Lists
Functions
Mini Projects
All Levels
Middle Stage (6–8)
High School (9–10)
High School (11–12)
Undergraduate
General
All
Easy
Medium
Hard
Sort
Mixed
Newest first
Oldest first
A to Z
13 problems
Type:
Any
Conceptual
Numerical
Python-Coded
1.
For the text "the cat sat on the mat", write the program lines that show: how many times at occurs…
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Strings
StemPy Lab
Medium
2.
A student wants to change the name "Rahul" to "Raju" and writes…
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Strings
StemPy Lab
Medium
3.
The variable word = "elephant" has eight letters.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Strings
StemPy Lab
Easy
4.
The name is "asha rao". Show its initials in capital letters: AR.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Strings
StemPy Lab
Hard
5.
For word = "banana", how many times do a, an and n appear?
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Strings
StemPy Lab
Easy
6.
A word that reads the same forwards and backwards is a palindrome.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Strings
StemPy Lab
Medium
7.
Three notebooks cost 249.5 rupees each. Show the total with exactly two decimal places, in the form…
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Strings
StemPy Lab
Medium
8.
name = "Asha" and age = 12. Use an f-string to show Asha is 12 years old.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Strings
StemPy Lab
Easy
9.
What do print("ha" * 3), print("Py" + "thon"), print("ab" * 2 + "c") and print("-" * 20) show?
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Strings
StemPy Lab
Easy
10.
A student writes word[0] = "J" to change Python into Jython.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Strings
StemPy Lab
Medium
11.
Show the first letter and the last letter of the word python.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Strings
StemPy Lab
Easy
12.
For word = "computer", what are word[0], word[-1], word[2:5] and word[::-1]?
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Strings
StemPy Lab
Medium
13.
For text = "Python Programming", find its length, its capital letters version, its small letters…
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Strings
StemPy Lab
Easy