Last active
May 1, 2025 08:20
-
-
Save ClimenteA/f5f38d566027febf7c7c47eaff09b1fe to your computer and use it in GitHub Desktop.
Freelance calculator - Calculate monthly rate based on working days and vacation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
year = int(input("Invoice year: ")) | |
month = int(input("Invoice month: ")) | |
monthly_rate = float(input("Monthly rate: ")) | |
print( | |
f"\nYou can verify working days here: https://romania.workingdays.org/workingdays_calendar_{year}_{month}.htm" | |
) | |
working_days = int(input("Working days: ")) | |
legal_holidays = int(input("Legal holidays if they are not in weekend: ")) | |
vacation_days = int(input("Vacation days: ")) | |
working_days_legal_holidays = working_days + legal_holidays | |
daily_rate = monthly_rate / working_days_legal_holidays | |
paid_vacation = daily_rate * vacation_days | |
worked_days = working_days - vacation_days | |
paid_worked_days = daily_rate * worked_days | |
total = paid_worked_days + paid_vacation | |
print("Daily rate: ", daily_rate) | |
print(f"Vacation {vacation_days} days at {daily_rate} = {paid_vacation}") | |
print(f"Worked {worked_days} days at {daily_rate} = {paid_worked_days}") | |
print(f"Total {total}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment