Question: Python: Why is the code in Listing 3.2 incorrect? # This code is incorrect swaps = input() ball_location = 1 == == 1: = ==
Python:
Why is the code in Listing 3.2 incorrect?

# This code is incorrect swaps = input() ball_location = 1 == == 1: = == == 2: == == 2: for swap_type in swaps: if swap_type 'A' and ball_location ball location 2 2 if swap_type 'A' and ball_location ball_location = 1 if swap_type 'B' and ball_location ball location 3 if swap_type 'B' and ball_location ball location 2 if swap_type 'C' and ball_location ball_location 3 if swap_type 'C' and ball_location ball_location = 1 == == 3: = == == 1: = == == 3: print(ball_location) Listing 3-2: Solving Three Cups incorrectly
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
