← 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))
- A.+919876543210 13
- B.919876543210 12
- C.+91-98765-43210 15
- 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 →