← Quiz: Test Case Design: all 10 questions
Quiz: Test Case Design · Question 6 of 10
What does this print? (code)
What does this print?
from itertools import product
rules = list(product('YN', repeat=4))
print(len(rules), rules[5])
- A.16 ('Y', 'N', 'Y', 'N')
- B.8 ('Y', 'N', 'Y', 'N')
- C.16 ('N', 'Y', 'N', 'Y')
- D.4 ('Y', 'Y', 'N', 'N')
Answer & explanation
Correct answer: 16 ('Y', 'N', 'Y', 'N')
4 yes/no conditions give 2⁴ = 16 rules; index 5 is binary 0101 with Y as 0.
Can you get the rest right without peeking?
Take the timed Quiz: Test Case Design quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →