I have tried it in a bunch of different ways and this is one. but the idea is to define a list in one function but i cant get it to use the list in a second function. Then i also have to cube the even numbers in list 2.
def main():
print (list1())
print()
print (list2())
def list1():
list1 = []
for i in range (100):
list1.append(random.randint(2, 25))
return list1
def list2():
i = 0
list2 = []
for i in list1():
if (i % 2 == 0):
list2.append(i)
return list2
global list1inlist2(), which is general a bad idea.