Question 2
Back to Exercise
Which function is best for checking that a whole input is a 6-digit PIN code?
- A re.fullmatch(r"\d{6}", pin) Correct
- B re.search(r"\d{6}", pin)
- C re.findall(r"\d", pin)
- D re.split(r"\d{6}", pin)
Correct Answer: Option A
search would also accept "1234567" or "PIN 123456".
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!