-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjobs_utils.py
72 lines (55 loc) · 1.47 KB
/
jobs_utils.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import csv
class Job:
def __init__(self, name, state):
self.name = name
self.state = state
class Year(Job):
def __init__(self, name, state, pay, year):
super().__init__(name, state)
self.pay = pay
self.year = year
def show_year(self):
return self.year
def show_pay(self):
x = self.pay
x = int(x)
return x
def search_state(a):
state_dict = {}
with open("jobs.csv", "r") as jobs:
csv_reader = csv.reader(jobs)
for line in csv_reader:
if len(line) > 2:
if line[0] == a:
state_dict[line[1]] = line
return state_dict
def get_job(b, c):
answer = ""
for job in b:
if job == c:
for i in b[job]:
if b[job].index(i):
answer = i
return answer
def get_years_pay(d, e):
pay_list = []
sal_list = []
for job in d:
if e == job:
for i in d[job]:
pay_list.append(i)
sal_list.append(pay_list[2])
sal_list.append(pay_list[5])
sal_list.append(pay_list[6])
sal_list.append(pay_list[7])
sal_list.append(pay_list[8])
return sal_list
def get_description(b, c):
answer = ""
pay_list = []
for job in b:
if job == c:
for i in b[job]:
pay_list.append(i)
answer = pay_list[3]
return answer