← 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))
- A.call me on <PHONE> or <PHONE>
- B.call me on 9876543210 or 1234567890
- C.call me on <PHONE> or 1234567890
- 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 →