'If else to check for multiple conditions but one text input

I am trying to create a take-off on a 3-Cup Monte Program. Students using Brython in CodeHS Ide to draw "cups" and a white ball that will randomly appear in one of the cups. That part is working. However, when the user guesses by typing input: left, right or middle, the console should print the input and either 'You Guessed It' or 'Bad Answer'. But the answer always comes up as 'Bad Answer' even when the ball is in the correct cup or not.

Screenshot of game : [game table with cups. user input is 'left', the ball is in the correct(left) cup, yet program prints 'Bad Answer'][1]

Here is my code so far:

def func_left():
    left_ball = Circle(36)
    left_ball.set_color(Color.white)
    left_ball.set_position(80,200)
    add(left_ball)

def func_middle():
    middle_ball = Circle(36)
    middle_ball.set_color(Color.white)
    middle_ball.set_position(200,200)
    add(middle_ball)
    
def func_right():
    right_ball = Circle(36)
    right_ball.set_color(Color.white)
    right_ball.set_position(320,200)  
    add(right_ball)
    
my_list = [func_left, func_middle, func_right]
random.choice(my_list)()




guess = (input(" Do yo think the ball is under the left, middle, or right cup?: "))
print (guess)

if guess == "left" and func_left:
        print("You Guessed It!")
        
if  guess == "middle" and my_list == func_middle:
        print("You Guessed It!")

if guess == "right" and my_list == func_right:
         print("You Guessed It!")
else:
    print("Bad Answer!")


  [1]: https://i.stack.imgur.com/Au66d.png


Solution 1:[1]

Try to use if, elif, else structure

if guess == "left" and func_left:
        print("You Guessed It!")
        
elif  guess == "middle" and my_list == func_middle:
        print("You Guessed It!")

elif guess == "right" and my_list == func_right:
         print("You Guessed It!")
else:
    print("Bad Answer!")

Solution 2:[2]

Try this -

def func_left():
    left_ball = Circle(36)
    left_ball.set_color(Color.white)
    left_ball.set_position(80,200)
    add(left_ball)
    return 'left'

def func_middle():
    middle_ball = Circle(36)
    middle_ball.set_color(Color.white)
    middle_ball.set_position(200,200)
    add(middle_ball)
    return 'middle'

def func_right():
    right_ball = Circle(36)
    right_ball.set_color(Color.white)
    right_ball.set_position(320,200)  
    add(right_ball)
    return 'right'

my_list = [func_left, func_middle, func_right]
random_choice = random.choice(my_list)()

guess = (input(" Do yo think the ball is under the left, middle, or right cup?: "))
print (guess)

if guess == "left" and random_choice == 'left':
        print("You Guessed It!")
        
elif  guess == "middle" and random_choice == 'middle':
        print("You Guessed It!")

elif guess == "right" and random_choice == 'right':
         print("You Guessed It!")
else:
    print("Bad Answer!")

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 KamuiYato
Solution 2 Kush Agrawal