CodeSolved

A comprehensive source of programming questions and exercises

Conversion

Practice Easy 1234/ Download 384 Views

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

For example:

Input: 80
3 days, 8 hours

13 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")
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("لطفاً یک عدد صحیح وارد کنید.")
Milad.bio Download Python
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.")
User 136 Download Python
<< Previous page 1 2 Next page >>

Submit answer

Submitting answers is currently unavailable.

×
×
Close