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

Quiz: AI Coding Risks · Question 6 of 10

What does this print? (code)

What does this print?

import re
text = "call me on 9876543210 or 1234567890"
print(re.sub(r"\b[6-9]\d{9}\b", "<PHONE>", text))
  1. A.call me on <PHONE> or <PHONE>
  2. B.call me on 9876543210 or 1234567890
  3. C.call me on <PHONE> or 1234567890
  4. D.<PHONE>
Answer & explanation

Correct answer: call me on <PHONE> or 1234567890

Only 10-digit numbers starting with 6, 7, 8 or 9 match the Indian mobile pattern.

Can you get the rest right without peeking?

Take the timed Quiz: AI Coding Risks quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →