blob: 382c14587cebf3918fa7e1a2695bacf2496043c5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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)
|