Skip to main content
🔒 Preview mode. The first 15 Foundations lessons are free; this one is Pro. Start a 7-day trial to unlock the editor, AI hints and the rest of the curriculum. Card required, cancel any time in Dashboard.Start 7-day trial →
← CoursesDevOps for Python servicesModule 5 · Cloud, IaC, Secrets, Cost · RecapBlue/green vs canary vs rollingpredict93 / 104
+100 XP
Task
📝 **Task:** Print the tuple `(max_total, min_available)` for `replicas=10, maxSurge=25%, maxUnavailable=25%` per the K8s rolling-update bounds above. 📋 Implement the function above. Tests run automatically. 💡 **Hint:** Re-read the theory if you get stuck.
Predict the output

Read the code carefully

import math

replicas = 10
max_surge_pct = 25
max_unavailable_pct = 25

# maxSurge rounds UP -> ceil; maxUnavailable rounds DOWN -> floor
max_total = replicas + math.ceil(replicas * max_surge_pct / 100)
min_available = replicas - math.floor(replicas * max_unavailable_pct / 100)
print((max_total, min_available))

What will the program print? Write here:

💬 Discussion

Be the first to ask a question or share a tip.
Sign in to join the discussion. Reading is free.
Loading discussion…