This program is meant to execute two programs based on user input. If the user inputs 1, it executes program_a. If the user inputs 2, it executes program_b. How do I make it so that if a user inputs any other integer, it randomly chooses between 1 or 2?
import random
choice = int(input("Enter the number for your choice: "))
r = random.randint(1,2)
if choice == 1:
program_a()
elif choice == 2:
program_b()
else:
choice = r