def predict(x, w, b): return w * x + b # the values we picked by eye w = 5 b = 7 # a list of distances we want predictions for distances = [1, 2, 3, 4, 5, 6] # predicting one by one, using a normal loop predictions = [] for x in distances: predictions.append(predict(x, w, b)) print(predictions) # [12, 17, 22, 27, 32, 37] __ __