← Quiz: Git Config, .gitignore and Hooks: all 10 questions
Quiz: Git Config, .gitignore and Hooks · Question 8 of 10
What does this print? (code)
What does this print?
import re
PATTERN = re.compile(r"^(feat|fix|docs)(\([a-z-]+\))?: .{3,72}$")
for m in ["docs: update README", "feat(cart) add coupon", "fix(api): handle 404"]:
print(bool(PATTERN.match(m)), end=" ")
- A.True True True
- B.True False False
- C.True False True
- D.False False True
Answer & explanation
Correct answer: True False True
The second message is missing the colon after (cart), so it does not match.
Can you get the rest right without peeking?
Take the timed Quiz: Git Config, .gitignore and Hooks quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →