I made a card flipping game if you want to learn how to play it go here https://www.youtube.com/watch?v=CCxs-tu8tOU
numbers = [0, 1, 0, 0, 1, 1, 0]
options = []
for num in range(0, len(numbers)):
if numbers[num] == 1:
options.append(num)
choice = int(input("Here's a list of cards: {}, your options are {}: ".format(numbers, options)))
The code below is too long and I need help simplifying it
if choice in options:
numbers[choice] = '.'
if numbers[choice-1] == 0:
numbers[choice-1] = 1
elif numbers[choice-1] == 1:
numbers[choice-1] = 0
if numbers[choice+1] == 0:
numbers[choice+1] = 1
elif numbers[choice+1] == 1:
numbers[choice+1] = 0