diff options
| author | Syndamia <kami02882@gmail.com> | 2019-06-30 15:05:38 +0300 |
|---|---|---|
| committer | Syndamia <kami02882@gmail.com> | 2019-06-30 15:05:38 +0300 |
| commit | a0addea2b7bbdac244420ec917c0f3c14c4c8831 (patch) | |
| tree | a05310b0033f995dfd31b5795e7675aa382a18f3 /Python/Beginner training/012 FitnessVisitors.py | |
| parent | 0c7164435abda2e497957e195e6653f94f20135d (diff) | |
| download | Self-learning-a0addea2b7bbdac244420ec917c0f3c14c4c8831.tar Self-learning-a0addea2b7bbdac244420ec917c0f3c14c4c8831.tar.gz Self-learning-a0addea2b7bbdac244420ec917c0f3c14c4c8831.zip | |
Added some of the stuff I have done while learning Python
Diffstat (limited to 'Python/Beginner training/012 FitnessVisitors.py')
| -rw-r--r-- | Python/Beginner training/012 FitnessVisitors.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Python/Beginner training/012 FitnessVisitors.py b/Python/Beginner training/012 FitnessVisitors.py new file mode 100644 index 0000000..382c145 --- /dev/null +++ b/Python/Beginner training/012 FitnessVisitors.py @@ -0,0 +1,25 @@ +import sys +import math +import random +import os + +names = list(input("Type names: ").split(", ")) + +while True: + command = input() + if command == "END": break + + if command == "Add visitor": + names.append(input()) + elif command == "Add visitor on position": + name_to_insert = input() + names.insert(int(input()), name_to_insert) + elif command == "Remove visitor on position": + names.pop(int(input())) + elif command == "Remove last visitor": + names.pop(len(names) - 1) + elif command == "Remove first visitor": + names.pop(0) + else: print("ERROR, indxistant command") + +print(names) |
