Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- day = int(input())
- workday = (365 - day) * 63
- holiday = day * 127
- total = workday + holiday
- diff = abs(total - 30000)
- if total >= 30000:
- print('Tom will run away')
- print(f'{diff // 60} hours and {diff % 60} minutes more for play')
- else:
- print('Tom sleeps well')
- print(f'{diff // 60} hours and {diff % 60} minutes less for play')
- Решение с тернарен оператор:
- day = int(input())
- total = ((365 - day) * 63 + day * 127) - 30000
- print('Tom will run away' if total >= 0 else 'Tom sleeps well')
- print(f'{abs(total) // 60} hours and {abs(total) % 60} minutes {"more" if total >= 0 else "less"} for play')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement