Tell us what’s happening:
All the results are correct, except infected(25). Who can help to have a look, what’s the problems. Really appriciate. Thanks.
Your code so far
def infected(days):
computers = 1
for i in range(days):
computers += computers
if (i+1) % 3 == 0 and i != 0:
computers -= round(computers * 0.2)
return computers
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36
Challenge Information:
Daily Coding Challenge - Infected
https://www.freecodecamp.org/learn/daily-coding-challenge/2025-11-02