Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hour_exam = int(input())
- minute_exam = int(input())
- hours_student = int(input())
- minute_student = int(input())
- exam_minutes = hour_exam * 60 + minute_exam
- student_minutes = hours_student * 60 + minute_student
- diff = abs(exam_minutes - student_minutes)
- if student_minutes > exam_minutes:
- print("Late")
- if diff < 60:
- print(f'{diff} minutes after the start')
- else:
- print(f'{diff // 60}:{diff % 60:02} hours after the start')
- else:
- if 0 <= diff <= 30:
- print('On time')
- else:
- print('Early')
- if 0 < diff < 60:
- print(f'{diff} minutes before the start')
- elif diff != 0:
- print(f'{diff // 60}:{diff % 60:02} hours before the start')
- РЕШЕНИЕ С ТЕРНАРЕН ОПЕРАТОР:
- hour_exam = int(input())
- minute_exam = int(input())
- hours_student = int(input())
- minute_student = int(input())
- diff = (hour_exam * 60 + minute_exam) - (hours_student * 60 + minute_student)
- print('On time' if 0 <= diff <= 30 else 'Early' if diff > 30 else 'Late')
- print(f'{abs(diff)} minutes {"before" if diff > 0 else "after"} the start' if 0 < abs(diff) < 60 else
- f'{abs(diff) // 60}:{abs(diff) % 60:02} hours {"before" if diff > 0 else "after"} the start')
- И ЛЕКО ТАРИКАТСКАТА:)
- diff = (int(input()) * 60 + int(input())) - (int(input()) * 60 + int(input()))
- print('On time' if 0 <= diff <= 30 else 'Early' if diff > 30 else 'Late')
- print(f'{abs(diff)} minutes {"before" if diff > 0 else "after"} the start' if 0 < abs(diff) < 60 else
- f'{abs(diff) // 60}:{abs(diff) % 60:02} hours {"before" if diff > 0 else "after"} the start')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement