HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClassesGroups

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Blog

Account

  • Dashboard
  • My Content
  • Profile
  • Log in
© 2026 senLearn. All rights reserved.HelpAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Problems
  2. /Python Basics
  3. /Strings

Strings

Python Programming
+ Upload a Problem
More in Python BasicsGetting Started with PythonVariables and Data TypesOperators and ExpressionsInput and OutputStringsConditionals: if, elif, elseLoopsListsFunctionsMini Projects
13 problems
Type:
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 · StringsStemPy LabStemPy 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 · StringsStemPy LabStemPy Lab
Medium
3.
The variable word = "elephant" has eight letters.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · StringsStemPy LabStemPy 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 · StringsStemPy LabStemPy 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 · StringsStemPy LabStemPy 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 · StringsStemPy LabStemPy 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 · StringsStemPy LabStemPy 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 · StringsStemPy LabStemPy 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 · StringsStemPy LabStemPy 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 · StringsStemPy LabStemPy 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 · StringsStemPy LabStemPy 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 · StringsStemPy LabStemPy 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 · StringsStemPy LabStemPy Lab
Easy