🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Bash Scripting for DevOps: all 10 questions

Quiz: Bash Scripting for DevOps · Question 8 of 10

What does this print? (code)

What does this print?

from datetime import datetime, timedelta
t = datetime(2026, 11, 21, 3, 0)     # a Saturday
runs = 0
for _ in range(7 * 24 * 60):
    t += timedelta(minutes=1)
    if t.minute == 30 and t.hour == 2 and t.isoweekday() in range(1, 6):
        runs += 1
print(runs)
  1. A.7
  2. B.5
  3. C.6
  4. D.2
Answer & explanation

Correct answer: 5

In one full week, the schedule 02:30 Monday to Friday fires exactly 5 times.

Can you get the rest right without peeking?

Take the timed Quiz: Bash Scripting for DevOps quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →