CodeSolved

Solved Programming Questions & Exercises

Conversion

Practice Easy 1234/ Download 668 Views

Write a program that numerals asHoursReceive and make it toDay and hourTurn

For example:

Input: 80
3 days, 8 hours

15 Answers

This answer is only visible to premium members
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

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
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

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
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

This answer is only visible to premium members

Subscription is currently unavailable.
import time
hou=int(input('hours:  '))
d=hou/24
d=int(d)
h=hou%24
print(d,'days  ',h,'hours')
s=input('khoroog')
Saleh1391 Download Python
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")
Sumy.amiri Download Python
hur=int(input("hur:"))
d=(int(hur/24))
h=hur%24
print('d {} , h {}'.format(d , h))
This is the easiest way possible
hour = int(input("چند ساعت : "))
a = hour // 24
b = hour % 24
print('day',a)
print('hour',b)
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("لطفاً یک عدد صحیح وارد کنید.")
Milad.bio Download Python
a=int(input("Please enter the hours:\n"))
if (a//24)==1 and (a%24) !=1:
    print(f"1 day, {a%24} hours")
elif (a//24)!=1 and (a%24) ==1:
    print(f"{a//24}days, 1 hour")
elif (a//24)==1 and (a%24) ==1:
    print("1 day, 1 hour")
elif (a//24)!=1 and (a%24) !=1:
    print(f"{a//24}days,{a%24} hours")

Zaras Download Python
<< Previous page 1 2 Next page >>

Submit answer

Submitting answers is currently unavailable.

×
×
Close