← Quiz: Linux for DevOps: all 10 questions
Quiz: Linux for DevOps · Question 6 of 10
What does this print? (code)
What does this print?
value = {"r": 4, "w": 2, "x": 1, "-": 0}
perm = "rwxr-x---"
print("".join(str(sum(value[c] for c in perm[i:i + 3])) for i in (0, 3, 6)))
- A.755
- B.705
- C.740
- D.750
Answer & explanation
Correct answer: 750
rwx = 7, r-x = 5, --- = 0, giving 750.
Can you get the rest right without peeking?
Take the timed Quiz: Linux for DevOps quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →