import random #this function randomly generates a list of floating point numbers and format the numbers def make_list_formatted(size, min, max): my_list=[] for i in range(size): a = random.uniform(min, max) a_format = float("{0:.2f}".format(a)) my_list.append(a_format) #could be written in one line #my_list.append(float("{0:.2f}".format(random.uniform(min, max)))) return my_list