-
Notifications
You must be signed in to change notification settings - Fork 1
/
skill_mapping.py
58 lines (45 loc) · 1.84 KB
/
skill_mapping.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
"""
This module will contain mappings of programming languages to skills.
Users can inquire with programming languages and see suggestions that they can work on for improvement and further
advancement.
"""
from skills import *
languages = ['java', 'python', 'html', 'css', 'javascript', 'ruby', 'matlab', 'r']
def get_skills(lang, spec=None):
"""
returns the list of skills required for this language
:param spec: specification for different things
:param lang: language name (string)
:return: list of skills
"""
if lang.lower() == 'java':
output = get_java(spec)
if spec is not None:
print(f"Our suggestions for {spec} are: ", end='')
print(*output[:-1], sep=', ', end='')
print(f" and {output[-1]}.\n")
else:
print("Our suggestions for are: ", end='')
print(*output[:-1], sep=', ', end='')
print(f" and {output[-1]}.\n")
elif lang.lower() == 'python':
output = get_python(spec)
if spec is not None:
print(f"Our suggestions for {spec} are: ", end='')
print(*output[:-1], sep=', ', end='')
print(f" and {output[-1]}.\n")
else:
print("Our suggestions for are: ", end='')
print(*output[:-1], sep=', ', end='')
print(f" and {output[-1]}.\n")
if __name__ == '__main__':
print("Languages available are: ", end='')
print(*languages[:-1], sep=', ', end='')
print(f" and {languages[-1]}.\n\n")
lang = input("Enter the language you want to inquire about: ")
while lang.lower() not in languages:
lang = input("Enter the language you want to inquire about: ")
spec = input(f"Now please enter a specification, if any, you want to inquire about for {lang}: ")
if spec == "":
spec = None
get_skills(lang, spec)