+ 2

Время дня

how to write a program so that when entering time it knows that it is morning, afternoon, evening, night

15th Nov 2020, 2:28 PM
Roman Vorko
Roman Vorko - avatar
16 ответов
+ 9
Where is your attempt? Post it here! Edit: Roman Vorko try this one. It's easy way out. https://code.sololearn.com/cj855Ay2dpnW/?ref=app
15th Nov 2020, 3:46 PM
Simba
Simba - avatar
+ 2
In which language did you try to get it? First of all you have to ask in this language what time is it.
15th Nov 2020, 6:18 PM
JaScript
JaScript - avatar
+ 2
Roman Vorko Your welcome and congratulation.
15th Nov 2020, 7:27 PM
JaScript
JaScript - avatar
+ 1
This code greet you after the time of day: Приветствие по коду по времени суток: https://code.sololearn.com/w2yqPJJ8ew39/?ref=app
15th Nov 2020, 5:39 PM
JaScript
JaScript - avatar
+ 1
My example is in PHP.
15th Nov 2020, 6:35 PM
JaScript
JaScript - avatar
+ 1
If you like you can see the solution in python live: https://code.sololearn.com/cxwqoY7WZ2Tc/?ref=app
15th Nov 2020, 6:51 PM
JaScript
JaScript - avatar
+ 1
Thanks 👍
15th Nov 2020, 7:11 PM
Roman Vorko
Roman Vorko - avatar
+ 1
I wrote a little longer, but I corrected it too ...💪😁
15th Nov 2020, 7:13 PM
Roman Vorko
Roman Vorko - avatar
0
👍😁✌️
15th Nov 2020, 2:34 PM
Roman Vorko
Roman Vorko - avatar
0
constant: day_time (0--24) MYTIME = int(input ("Enter time [0-24]:")) # to do: create texts English, Russian , Hebrew MYNIGHT = "Good night" MYMORNING = "Good morning" MYDAY = "Good day" MYEVENING = "Good evening" # To do: ask user Lenguage: if MYTIME >=22 and MYTIME <8: # night out_sring = MYNIGHT pass elif MYTIME >=8 and MYTIME <12: # morning out_sring = MYMORNING elif MYTIME >12 and MYTIME <=18: # day out_sring = MYDAY else: MYTIME <18 and MYTIME >22 out_sring = MYEVENING print (out_sring)
15th Nov 2020, 5:55 PM
Roman Vorko
Roman Vorko - avatar
0
I tried to write this, but it does not work correctly ...
15th Nov 2020, 5:56 PM
Roman Vorko
Roman Vorko - avatar
15th Nov 2020, 6:29 PM
Roman Vorko
Roman Vorko - avatar
0
In English
15th Nov 2020, 6:30 PM
Roman Vorko
Roman Vorko - avatar
0
# constant: day_time (0--24) MYTIME = int(input ("Enter time [0-24]:")) # to do: create texts English, Russian , Hebrew MYNIGHT = "Good night" MYMORNING = "Good morning" MYDAY = "Good day" MYEVENING = "Good evening" # To do: ask user Lenguage: if MYTIME >=0 and MYTIME <8: # night out_sring = MYNIGHT pass elif MYTIME >=8 and MYTIME <12: # morning out_sring = MYMORNING elif MYTIME>=12 and MYTIME <18: # day out_sring = MYDAY elif MYTIME >=18 and MYTIME <22: # evening out_sring = MYEVENING else: out_sring = MYNIGHT print (out_sring)
15th Nov 2020, 7:12 PM
Roman Vorko
Roman Vorko - avatar
0
J
17th Nov 2020, 10:29 AM
the gaming star
the gaming star - avatar