🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Python Interview Programs: all 13 questions

Quiz: Python Interview Programs · Question 6 of 13

What does this print? (code)

What does this print?

s = "racecar"
print(s == s[::-1])
  1. A.True
  2. B.False
  3. C.racecar
  4. D.An error
Answer & explanation

Correct answer: True

A palindrome reads the same backwards.

Can you get the rest right without peeking?

Take the timed Quiz: Python Interview Programs quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →