Computer Science, asked by nilampatidar229874, 10 months ago

write a program that reads from user-(a) an hour between 1 to 12
(b) number of hours ahead.
The program should print the time after those many hours
E.g. enter time between 1 to 12:9
How many hours ahead:5
Time at that would be: 2 o' clock

Answers

Answered by rahulkeshri8737
0

Answer:

Newest Questions

Multiple Choice Questions (MCQs):The computers that are involved in the network that originate, route and terminate the data1.are:a. Hub2.a. Routerb.

Why operating system is named as resource management?

Write about lookup and reference functions

Write a python program to accept the body tempreature of a person and check if he has fever.(Take normal temp. 98.6°F)

Is python case sensitive when dealing with identifiers? Yes,No,Machine dependent,none of these

What is hexadecimal number system

What is functions in computer science?

What is the border used for? how can you surround a paragraph with border?

It is required to design and implement: 1. A counter which counts from 0 to 255 with seven segment display. 2. A logic function y=∑( 0,3,5,10,16,20,30

Explain how the internet works??

Answered by rahulkumarthakur9876
0

Answer:

.

hrs = eval(input('ENTER HOUR: '))

ahead = eval(input('HOW MANY HOURS AHEAD: '))

new_hour = hrs+ahead

a = 1

b = 2

c = 3

d = 4

e = 5

f = 6

g = 7

h = 8

i = 9

j = 10

k = 11

l = 12

if new_hour <= 12:

print(hrs+ahead)

if new_hour == 13:

print(a)

if new_hour == 14:

print(b)

if new_hour == 15:

print(c)

if new_hour == 16:

print(d)

if new_hour == 17:

print(e)

if new_hour == 18:

print(f)

if new_hour == 19:

print(g)

if new_hour == 20:

print(h)

if new_hour == 21:

print(i)

if new_hour == 22:

print(j)

if new_hour == 23:

print(k)

if new_hour == 24:

print(l)

#2 method

if new_hour % 12 == 0:

print(12)

else:

print(new_hour % 12)

Similar questions