Last active
April 4, 2023 08:03
-
-
Save olya-gif/3fd45fcf0337d7b42c3469165c2a1c6d to your computer and use it in GitHub Desktop.
less_49 practik job 12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| want = float(input("Яку суму ви хочете отримати? ")) | |
| have = float(input("Яку суму ви маєте? ")) | |
| suma = have | |
| year = 0 | |
| while suma <= want: | |
| suma = suma + 0.25 * suma | |
| year = year + 1 | |
| print(f'на {year} рік ви отримаєте {suma} гривень') | |
| print(f'вам потрібно покласти кошти на депозит на {year} років') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| want = float(input("Яку суму ви хочете отримати? ")) | |
| have = float(input("Яку суму ви маєте? ")) | |
| prosent = float(input('Введіть відсоткову ставку ')) | |
| suma = have | |
| year = 0 | |
| while suma <= want: | |
| suma = suma + (prosent / 100) * suma | |
| year = year + 1 | |
| print(f'на {year} рік ви отримаєте {suma} гривень') | |
| print(f'вам потрібно покласти кошти на депозит на {year} років') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| s = int(input('Скільки грн у учнів? ')) | |
| new = int(input('Скільки коштує чистий зошит? ')) | |
| full = int(input('Скільки коштує списаний зошит? ')) | |
| count_new = 0 | |
| count = 0 | |
| while s >= new: | |
| count = s / new | |
| count_new = count_new + count | |
| s = count * full | |
| print(f'Учні можуть купити {int(count_new)} зошитів') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| max_weight_start = 4000 # максимальна вага багажу | |
| min_weight = 20 # мінімальна вага валізи | |
| max_weight_per_bag = 40 # максимальна вага однієї валізи | |
| min_bags = 0 | |
| max_bags = 0 | |
| max_weight = max_weight_start | |
| while min_weight <= max_weight: | |
| max_weight = max_weight - min_weight | |
| min_bags = min_bags + 1 | |
| max_weight = max_weight_start | |
| while max_weight_per_bag <= max_weight: | |
| max_weight = max_weight - max_weight_per_bag | |
| max_bags = max_bags + 1 | |
| print(f'Літак може вмістити від {min_bags} до {max_bags} валіз') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| max_weight_start = int(input('Введіть скільки літак вміщує кг багажу? ')) | |
| min_weight = int(input('Введіть мінімальну вагу валізи ')) | |
| max_weight_per_bag = int(input('Введіть максимальну вагу валізи ')) | |
| min_bags = 0 | |
| max_bags = 0 | |
| max_weight = max_weight_start | |
| while min_weight <= max_weight: | |
| max_weight = max_weight - min_weight | |
| min_bags = min_bags + 1 | |
| max_weight = max_weight_start | |
| while max_weight_per_bag <= max_weight: | |
| max_weight = max_weight - max_weight_per_bag | |
| max_bags = max_bags + 1 | |
| print(f'Літак може вмістити від {min_bags} до {max_bags} валіз') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| first_day = 4 | |
| next_day = 2 | |
| exit_day = 0 | |
| while first_day <= 108: | |
| first_day = first_day + next_day | |
| exit_day = exit_day + 1 | |
| print(f'На {exit_day} день секретар буде відповідати на 108 листів') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| first_day = int(input('Введіть кількість листів на перший день ')) | |
| next_day = int(input('Введіть на скільки більше листів він відкриває щодня ')) | |
| max_mess_on_day = int(input('Введіть максимальне значення листів на день ')) | |
| exit_day = 0 | |
| while first_day <= max_mess_on_day: | |
| first_day = first_day + next_day | |
| exit_day = exit_day + 1 | |
| print(f'Секретар на {exit_day} відкриє {first_day} листів') | |
| print(f'На {exit_day} день секретар буде відповідати на 108 листів') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment