-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathmethods.py
63 lines (52 loc) · 1.79 KB
/
methods.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
# Create the following methods and make sure they return the correct data type
# and/or value
# #1: Create a method called num_list_with_arg that takes a positive integer and
# returns a list of integers between 1 and the number passed in.
#
# So if the number 5 is passed in, num_list_with_arg should return [1, 2, 3, 4]
# #2: Modify the has_ruby_exp method below so that it returns a SORTED list of
# all instructors who have Ruby experience (i.e. where "ruby" == True)
# The list should contain only names of instructors.
# make sure you name the list ruby_experience before returning it.
def has_ruby_exp():
ruby_experience = []
experience = {
'jimmy': {
'bjj': False,
'soccer': False,
'ruby': True,
'baking': True,
'biking': True,
'pasta': False
},
'don': {
'bjj': False,
'soccer': False,
'ruby': True,
'baking': True,
'biking': False,
'pasta': False
},
'zakk': {
'bjj': False,
'soccer': False,
'ruby': True,
'baking': False,
'biking': False,
'pasta': True
},
'hector': {
'bjj': True,
'soccer': True,
'ruby': False,
'baking': False,
'biking': True,
'pasta': False
}
}
# #3: Create a method called toggle_str_num that takes an argument. If the
# argument is a string, convert it to an integer and return the integer; If the
# argument is an integer, convert it to a string and return the string; If the
# argument is neither a string nor an integer, return the string "this is not a
# str or a int":
# Commit when you finish working on these questions!