Help
Contact
For teachers and institutes
Search courses, problems, tests…
A
A
>_
StemPy Lab
Courses ▾
Problems ▾
Practice ▾
Mock Tests
Classes
Community ▾
A
A
Quizzes
/
A loop cuts a string into pieces of two characters and builds a new string from the pieces. What does the program print?
Python Programming
Medium
High School (9–10)
Python Basics › Strings
PCEP (Python Institute)
Created by
StemPy Lab
Stuck? Show a hint
A loop cuts a string into pieces of two characters and builds a new string from the pieces.
s = "abcdef" t = "" for i in range(0, len(s), 2): t = s[i:i + 2] + t print(t)
What does the program print?
efcdab
badcfe
abcdef
fedcba
Check Answer
Log in to save
Tag someone
⚑ Report
← All Quizzes
← A student wants to change the word "data" so that it starts with a capital D. The program starts with s = "data", and then one of four lines is run. Which line runs with no error?
Five claims about the word loop use the in operator, slices that start inside or past the end, and the ordering of text. Pick the claims that hold. More than one may be right. →
More on
Python Basics › Strings
Discussion (0)
Log in
to join the discussion.
Loading…
All questions on this topic →
Problems on this topic
For the text "the cat sat on the mat", write the program lines that show: how many times at occurs…
Medium
A student wants to change the name "Rahul" to "Raju" and writes…
Medium
The variable word = "elephant" has eight letters…
Easy
The name is "asha rao". Show its initials in capital letters: AR.
Hard
All problems on this topic →