Solutions will be available when this assignment is resolved, or after a few failing attempts.

Lottery Time

Create a class called Lottery with that optionally receives a list numbers containing the possible winning numbers. If numbers is not received as an optional argument, set it to be a list ranging from 0-49. When created, your Lottery object should have an attribute answer created that is random number from the numbers list.

It needs to have two methods:
- get_answer that returns the answer variable for that object
- play that receives a number and returns True if the number matches the answer and False otherwise


l = Lottery(numbers=[9])
l.get_answer() # 9 # False # True

Test Cases

test get answer - Run Test

def test_get_answer():
    l = Lottery(numbers=[9])
    assert l.get_answer() is not None
    assert l.get_answer() == 9

test random range - Run Test

def test_random_range():
    l = Lottery()
    assert l.get_answer() is not None
    assert is True

test play - Run Test

def test_play():
    l = Lottery(numbers=[9])
    assert is False
    assert is True
# Import here! # Define your class here