Fill the ____
parts in the code below.
words = ['PYTHON', 'JOHN', 'chEEse', 'hAm', 'DOE', '123']
upper_case_words = []
for ____ in words:
if ____.isupper():
____.append(____)
assert upper_case_words == ['PYTHON', 'JOHN', 'DOE']
Calculate the sum of the values in magic_dict
by taking only into account numeric values (hint: see isinstance).
magic_dict = dict(val1=44, val2='secret value', val3=55.0, val4=1)
# Your implementation
sum_of_values =
assert sum_of_values == 100
The rules:
'five odd'
'five even'
'odd'
'even'
numbers = [1, 3, 4, 6, 81, 80, 100, 95]
# Your implementation
my_list =
assert my_list == ['odd', 'odd', 'even', 'even', 'odd', 'five even', 'five even', 'five odd']