-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlists_dicts_task.py
More file actions
119 lines (89 loc) · 2.57 KB
/
lists_dicts_task.py
File metadata and controls
119 lines (89 loc) · 2.57 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import time
skills = ['C++', 'AMPL', 'VDHL',
'VBA', 'Python', 'Javascript',
'R', 'Text Analyzing', 'Data Analyzing',
'Management', 'Cooking', 'Reading', 'Drawing',
'Video Editing', 'Photographing']
cv = {}
cv['name'] = input("Enter your name: ")
try:
cv['age'] = int(input("Enter your age: "))
cv['experience'] = int(input("Enter your years of experience: "))
except ValueError:
print("Invaild input!")
else:
cv['skills'] = []
cv['req'] = False
req_skills = ['C++', 'Python', 'R',
'Text Analyzing', 'Data Analyzing',
'Javascript', 'Management']
def show_help():
print("""
* Enter 'DONE' if you are done from adding skills
* Enter 'SHOW' to show skill set on CV
* Enter 'HELP' to show those instructions
""")
def add_skills(item):
if item.isdigit() == True:
item = int(item) - 1
for skill in skills:
if skills.index(skill) == item:
cv['skills'].append(skills[item])
print("ADDED! Total {} skills on your CV".format(len(cv['skills'])))
else:
print("Invaild entry, please enter a number!")
def show_skills():
count = 1
print("Current skills on your CV:")
for skill in cv['skills']:
print(count,"- ",skill)
count += 1
show_help()
i = 1
for skill in skills:
print("[", i, "] ", skill)
i += 1
print ("** Choose a skill from the list above by typing in the number (Max. 5 skills):")
while True:
user_input = input(">>")
if user_input == 'DONE':
break
elif user_input == 'HELP':
show_help()
continue
elif user_input == 'SHOW':
show_skills()
continue
elif len(cv['skills']) < 5:
add_skills(user_input)
continue
else:
print("Last entry was not taken! Maximum number of skills reached!")
break
show_skills()
time.sleep(1)
print("""
-------------------------------------------------
We are reviewing your application. Please wait...
-------------------------------------------------
""")
time.sleep(2)
num = 0
for skill in cv['skills']:
if skill in req_skills:
num += 1
if cv['age'] < 23 or cv['age'] > 35:
print("""Dear {}, we had to move on to another candidate. Best of Luck!
""".format(cv['name']))
elif cv['experience'] < 4:
print("""Dear {}, we had to move on to another candidate. Best of Luck!
""".format(cv['name']))
elif 'Cooking' not in cv['skills']:
print("""Dear {}, we had to move on to another candidate. Best of Luck!
""".format(cv['name']))
elif num < 2 :
print("""Dear {}, we had to move on to another candidate. Best of Luck!
""".format(cv['name']))
else:
print("""Congrats! You have been accepted, {}
""".format(cv['name']))