Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions Lesson20/pactice/part02/01_task_numbers.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,32 @@

### Решение задачи

```python
# TODO: you code here...
```
---
## "Амеба"


def num():
while True:
minutes = int(input("min : "))
if minutes > -1:
return minutes
else:
print("Число должно быть положительное!")


# Амебы

def am(minutes):
if minutes == 0:
return 1
periods = (minutes // 1)
return 2 ** periods


time = num()
amoebas = am(time)

print(f"{amoebas} ам. за {time} мин.")


### Данные для самопроверки

Expand All @@ -27,4 +49,4 @@
| 1 | 2 |
| 2 | 4 |
| 3 | 8 |
| 5 | 32 |
| 5 | 32 |