vendredi 1 novembre 2019

Is there any possible of printing responsive variables in if-else statement in Python?

I try to make a sudoku solver program. I want to get the variables who matches(positive-the true variables) with if-else statement. I make an example.

a = int(input("Write a number (1-9)"))

b = int(input("Write a number (1-9)"))

c = int(input("Write a number (1-9)"))

d = int(input("Write a number (1-9)"))


if (a = 2 or b = 2 or c = 3 or d = 4):

    print("if the user prints 2 for "a" variable I want to print here "a = 2" ")

Aucun commentaire:

Enregistrer un commentaire