I am trying to find the max and min of a list of random numbers without using any built in functions. I have this code, but its showing an invalid syntax error on the last line. Can someone help? Using spyder in python 3.7. Also I know that the random number list works, just the min code is not working.
import random
l = []
for i in range(0,50):
x = random.randint(1,10)
l.append(x)
print(l)
def minimum(list):
current_min = list[0]
for num in list:
if num < current_min:
current_min = num
return current_min
print minimum(l)