Answer:
import random
def buildList(lst, num):
for i in range(num):
lst.append(random.randint(100, 199))
return lst
user_input = int(input("How many values to add to the list: "))
my_list = []
print(buildList(my_list, user_input))
my_list.sort()
print(my_list)
This function takes in 2 parameters, a list, and an integer. It uses a for loop to generate a specified number of random integers between 100-199 and appends them to the list. The function then returns the list. The user is prompted to input the number of random integers they want to add to the list, this value is stored in the 'variable user_input'. Then the function is called with an empty list and the user-specified value. The resulting list is printed and then sorted and printed again.