🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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)))
  1. A.755
  2. B.705
  3. C.740
  4. 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 →