Conversion
Write a program that numerals asHoursReceive and make it toDay and hourTurn
For example:
Write a program that numerals asHoursReceive and make it toDay and hourTurn
For example:
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
import time hou=int(input('hours: ')) d=hou/24 d=int(d) h=hou%24 print(d,'days ',h,'hours') s=input('khoroog')
while True: hour = int(input("Exit press -1 to Continue Entre your number :")) if hour < 0 : break d = 24 day = hour // d h = hour % d print(f"day: {day}") print(f"hour:{h}") print("Program Exit")
hur=int(input("hur:")) d=(int(hur/24)) h=hur%24 print('d {} , h {}'.format(d , h))
number = int(input("please enter a number(hour): ")) day = number // 24 saat = number % 24 print(f"{number} hours = {day} day and {saat} hours")
def convert_hours_to_days_and_hours(total_hours): """Convert hours to days and remaining hours.""" days = total_hours // 24 # The number of days hours = total_hours % 24 # The remaining hours return days, hours # Get input from the user try: total_hours = int(input("لطفاً تعداد ساعتها را وارد کنید: ")) days, hours = convert_hours_to_days_and_hours(total_hours) print(f"{total_hours} ساعت برابر است با {days} روز و {hours} ساعت.") except ValueError: print("لطفاً یک عدد صحیح وارد کنید.")
a=int(input('input:')) d= int(a/24) h=a%24 if h==1: hour='hour' else: hour='hours' if d==1: day= 'day' else: day='days' print( d,day,",",h, hour)
def convert_hours_to_days_hours(total_hours): # Calculate the number of days and hours days = total_hours // 24 # Calculate the number of days hours = total_hours % 24 # Calculate the remaining watches return days, hours # Get input from the user input_hours = int(input("لطفاً عددی را به عنوان ساعت وارد کنید: ")) # Conversion of time to day and clock days, hours = convert_hours_to_days_hours(input_hours) # Display the result print(f"{input_hours} hours is equal to {days} days and {hours} hours.")
Submitting answers is currently unavailable.
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام If you don’t understand the exercise or can’t solve it for any reason, that’s completely
normal—don’t worry 😊
Try checking out easier exercises and reviewing different answers
submitted by others. Gradually, you can move on to more challenging exercises. Also, your answer
might be correct even if it’s different from others.