Question: THIS is my PYTHON program : from random import randint def randlist(): ans = () for i in range(6): ans.append(randint(1,59)) #print(ans) return ans def comparelist(x,
THIS is my PYTHON program :
from random import randint
def randlist():
ans = ()
for i in range(6):
ans.append(randint(1,59))
#print(ans)
return ans
def comparelist(x, y):
z = list(set(x).union(set(y)))
if len(z) is len(x):
return True
return False
l = input("Enter six numbers for the lottery:")
l = l.split()
try:
for a in range(0,len(l)):
l[a] = int(l[a])
except:
print("Enter integer values")
l.sort()
l = list(set(l))
if(len(l)!=6):
print("Invalid input")
exit()
for a in range(6):
if(l[a]59):
print("Invalid input")
exit()
for i in range(1,9001):
rlist1 = randlist()
rlist1.sort()
if comparelist(l,rlist1):
cost = (i-1)*3+1
print("On week "+i+", numbers are:"+','.join(rlist1))
print("You are a MILLION DOLLAR winner!!")
print("Your total return is $"+str(1000000-cost))
print("Total amount spent is $"+str(cost))
exit()
rlist2 = randlist()
rlist2.sort()
if comparelist(l,rlist2):
cost = (i-1)*3+2
print("On week "+i+", numbers are:"+','.join(rlist2))
print("You are a MILLION DOLLAR winner!!")
print("Your total return is $"+str(1000000-cost))
print("Total amount spent is $"+str(cost))
exit()
rlist3 = randlist()
rlist3.sort()
if comparelist(l,rlist3):
cost = (i-1)*3+3
print("On week "+i+", numbers are:"+','.join(rlist3))
print("You are a MILLION DOLLAR winner!!")
print("Your total return is $"+str(1000000-cost))
print("Total amount spent is $"+str(cost))
exit()
cost = 9000*3
print("Total amount spent is $"+str(cost))
This is my error:

Please fix the error and devlop the program following requirements:
Design, Style and proper Documentation
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
