HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_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 →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Earth and Environmental Science
  • Classes
  • Groups

Practice

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

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Quizzes
  2. /This program should print bat, but it stops with an error. Which change to the second line makes the program print bat?
Python ProgrammingMediumHigh School (11–12)Python Basics › StringsClass 12 BoardPCAP (Python Institute)
+3 more exams
APA-LevelIB
APA-LevelIBPCAP (Python Institute)
StemPy LabCreated by StemPy Lab

This program should print bat, but it stops with an error. s = "cat" s[0] = "b" print(s) Which change to the second line makes the program print bat?

Log in to save
← All Quizzes
← A product code is sliced, searched and changed in three ways. What does the program print?A string with spaces and dashes is cleaned and then split in two ways. What does the program print? →
More onPython Basics › Strings

Discussion (0)

Log in to join the discussion.

Loading…

More questions on this topic

  1. A function builds the initials of a name, which has two spaces after its first word. Then the…Medium
  2. Five claims about the word loop use the in operator, slices that start inside or past the end, and…Hard
  3. A loop cuts a string into pieces of two characters and builds a new string from the pieces. What…Medium
  4. A student wants to change the word "data" so that it starts with a capital D. The program starts…Medium
  5. A program takes two characters and a slice from a word. What does the program print?Easy
All questions on this topic →

Problems on this topic

  1. For the text "the cat sat on the mat", write the program lines that show: how many times at occurs…Medium
  2. A student wants to change the name "Rahul" to "Raju" and writes…Medium
  3. The variable word = "elephant" has eight letters…Easy
  4. The name is "asha rao". Show its initials in capital letters: AR.Hard
All problems on this topic →