🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Prompting for Code: all 10 questions

Quiz: Prompting for Code · Question 8 of 10

What does this print? (code)

What does this print?

import re
raw = "+91-98765-43210"
digits = re.sub(r"[\s\-()]", "", raw)
print(digits, len(digits))
  1. A.+919876543210 13
  2. B.919876543210 12
  3. C.+91-98765-43210 15
  4. D.9876543210 10
Answer & explanation

Correct answer: +919876543210 13

Spaces, dashes and brackets are removed; the + stays.

Can you get the rest right without peeking?

Take the timed Quiz: Prompting for Code quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →