Предмет: Информатика, автор: Аноним

програма має працювати в пайчарм

Розробити програму "календар"

Користувач вводить дату та ім'я
наприклад
дата 30.10.2022
ім'я Андрій

Ви на екран виводите --} Вітаю, (ім'я яке ввів користувач)! Зараз (дата яку ввів користувач) - Зима

результат має бути наприклад ось такий
Вітаю Андрій!
Зараз 30.10.2022 - Весна​

Ответы

Автор ответа: PavlikWest
1

from datetime import datetime

# Запитуємо дату та ім'я користувача

date_str = input("Введіть дату у форматі дд.мм.рррр: ")

name = input("Введіть своє ім'я: ")

# Перетворюємо введену дату у тип datetime

date = datetime.strptime(date_str, "%d.%m.%Y")

# Визначаємо пору року

if date.month in [12, 1, 2]:

   season = "Зима"

elif date.month in [3, 4, 5]:

   season = "Весна"

elif date.month in [6, 7, 8]:

   season = "Літо"

else:

   season = "Осінь"

# Виводимо вітання та пору року

print(f"Вітаю, {name}!")

print(f"Зараз {date.strftime('%d.%m.%Y')} - {season}")

Похожие вопросы
Предмет: Английский язык, автор: parkhometshlib
I. Match the words to make up phrases.
1) to wash a) meals
2) to roast b) the carpet
3) a wooden c) birthday
4) to cook d) snack
5) to feel e) the medicine
6) to take f) ill
7) to celebrate g) a pull-up
8) sour h) opener
9) healthy i) turkey
10) a microwave j) oven
11) to can k) up
12) to vacuum l) cream

II. Open the brackets and put the correct tense form of the verb.
1) Tom ___ (to iron) clothes every Saturday.
a. won’t iron b. doesn’t iron c. didn’t iron
2) My dad usually ___ (to take care) of our animals.
a. took care b. takes care c. had taken care
3) His father __ (not to watch) TV at the moment.
a. am not watching b. aren’t watching c. isn’t watching
4) She looks very sick. I think she ____ go to a doctor.
a. should b. must c. shouldn’t
5) Daisy’s father isn’t an athlete, ____?
a. isn’t he b. does he c. is he
6) He __ (to return) from the cinema at five o’clock.
a. had returned b. is returning c. had return
7) She __ (to enjoy) listening to his songs last night.
a. enjoyed b. has enjoyed c. enjoyes
8) My sister __ (to roast) a chicken every Sunday.
a. roasts b. roasted c. has been roasting
9) Brian wants ro keep a lizard as a pet, _____?
a. doesn’t he b. does he c. doesn’t Brian
10) Let's go to an Italian restaurant and have pizza , ___?
a. aren’t we b. shall we c. can we
11) Sarah, did you write this poem ___?
a. myself b. yourself c. yourselves
12) Tom __ (to travel) around the world next year.
a. travels b. will travel c. has traveled
13) I __ (to be) very busy last summer.
a. was b. were c. been
14) You __ (to play) with a ball for three hours already.
a. have been plating b. are playing c. will play
15) I __ (to go) to bed at ten o’clock tomorrow.
a. went b. go c. will go
16) You __ (to sleep) for ten hours already.
a. Have been sleeping b. slept c. sleep
17) I usually a double-decker bus tour. __ do I.
a. So b. Neither
18) I can’t leave. I ____ finish this report today.
a. should b. must c. shouldn’t
19) When __ you __ (to leave) home for school tomorrow?
a. are you leaving b. will you live c. did you leave
20) Look! The baby __ (to sleep).
a. am sleeping b. is sleeping c. are sleeping
21) You ___ remember to send that email. It’s very important.
a. should b. must c. shouldn’t
22) My computer often crashes and turns off by___.
a. myself b. himself c. itself
23) __ he __ (to play) now?
a. Did he play b. Is he playing c. Will he sleep
24) Alan made this food by ____.
a. myself b. themselves c. himself

III. Write the letter about:
1. Write the recipe of your favourite Ukrainian dish:
• What products do you need;
• What cooking equipment you use / she uses;
• Describe the process of cooking.

2. You write to your English-speaking friend:
• Tell him/ her what household chores you have;
• How often you do them;
• Who helps you;
• What you like/ don’t like doing most of all.

3. You were ill two weeks ago:
• Explain what happened to you;
• If the doctor visited you, what recommendation you got;
• What helped you recover.
Предмет: Українська мова, автор: Dudar0302
Предмет: Английский язык, автор: fedkovvadim