Reassign index
to be the middle index of the list list_of_numbers
. DO NOT hard-code a number (hard-coding means using literals; see L2, slide 27).
In [1]:
import numpy as np
np.random.seed(8948394)
list_of_numbers = np.random.randint(10, size = 100000).tolist()
index = -1
### BEGIN SOLUTION
### END SOLUTION
Reassign middle
to be the middle value of the list list_of_numbers
. DO NOT hard-code a number (hard-coding means using literals; see L2, slide 27).
In [2]:
import numpy as np
np.random.seed(95448)
list_of_numbers = np.random.randint(10, size = 100000).tolist()
middle = -1
### BEGIN SOLUTION
### END SOLUTION
In [ ]:
dictionary = {"voila": "in", "view": "a", "humble": "vaudvillian", "veteran": "cast", "vicariously": "as", "both": "victim", "and": "villain"}
key = "villain"
### BEGIN SOLUTION
### END SOLUTION
In [3]:
dictionary = {"voila": "in", "view": "a", "humble": "vaudvillian", "veteran": "cast", "vicariously": "as", "both": "victim", "and": "villain"}
value = "villain"
### BEGIN SOLUTION
### END SOLUTION
In [4]:
sentence = "A data scientist is someone who is better at computer science than a statistician, and better at statistics than a computer scientist."
last_word = None
### BEGIN SOLUTION
### END SOLUTION