-
Notifications
You must be signed in to change notification settings - Fork 0
/
blank.py
40 lines (31 loc) · 854 Bytes
/
blank.py
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#Imports here
import random
class UniqueIntegers():
def __init__(self, min=0, max=999999):
self.min = min
self.max = max
self.generated = []
def getInt(self):
if len(self.generated) == self.max-self.min+1:
print("Full :(")
raise ValueError("Full generator :(")
while True:
n = random.randint(self.min, self.max)
if n not in self.generated:
self.generated.append(n)
return n
def addGenerated(self, toAdd):
if isinstance(toAdd, list):
self.generated += toAdd
elif isinstance(toAdd, int):
self.generated.append(toAdd)
def deleteInt(self, n):
try:
self.generated.remove(n)
except:
print(f"ERROR: {n} was not generated")
## Implement class task here
## Implement class Todo here
if __name__ == "__main__":
print("Hello, welcome to Python WS!! :)")
## Implement terminal interface here