This issue can be easily resolved with the datetime
library, creating an object date
which represents the date and a timedelta
that represents the time interval to be considered.
from datetime import date, timedelta
DIAS = [
'Segunda-feira',
'Terça-feira',
'Quarta-feira',
'Quinta-Feira',
'Sexta-feira',
'Sábado',
'Domingo'
]
inicio = date(year=2018, month=4, day=26)
ferias = timedelta(days=137)
final = inicio + ferias
print(DIAS[final.weekday()]) # Segunda-feira
See working at Repl.it | Ideone | GitHub GIST
But as the focus of exercise is probably math, you just have to think about the operations to be done. If I go on vacation on day 3, Wednesday, and stay in it for 137 nights, that means I'll stay 19 full weeks plus 4 days. At the end of the 19 weeks, I will know that it will be a Wednesday again, so I only have to check which day of the week it will be 4 days later (but as it is a college exercise, I leave the implementation of this logic with you).