-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwk13redo.py
More file actions
30 lines (19 loc) · 790 Bytes
/
wk13redo.py
File metadata and controls
30 lines (19 loc) · 790 Bytes
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
# #!/bin/python3
import random
import string
def name_generator(department, number_instances):
dep = department.lower()
num = int(number_instances)
if dep in ['Sales', 'Accounting', 'Management']:
name_list = []
for n in range(0, num):
rand_list = random.choices(string.ascii_letters+string.digits, k=10)
name=dep+"-"+''.join(rand_list)
name_list.append(name)
return(name_list)
else:
return("Your department should not use this name generator as the departments currnet supported are: sales, accounting, and management")
dep_input = input("What is your department? ")
num_input = input("How many instances do you need named? ")
result = name_generator(dep_input, num_input)
print(result)