This is my program when i return num_list it doesn't work but when i put print it work smoothly,my program and another friend program is exactly same but his program working and mine not.
import random
def make_random_real():
num_list = []
for i in range(0, 10):
num_list.append(random.random())
return num_list
make_random_real()
In this version of the function, it just returns a value, so if you want to print it first you need to assign it to a variable like this:
then you can
print(result)which will show you the num_list in your function.If you just want to print it without any assignment then just change
return num_listtoprint num_listin yourmake_random_real()function.