I have no Idea if the title uses the correct terms but I am looking to get some code and to try and reduce the length of the code so It will be quicker for me to type in the assessment. Here is and Example of How it would look if I did it the long winded way.
Valid = True
while Valid:
Column = int(input("Insert Column: "))
Row = int(input("Insert Row: "))
if Row < 0 or Row > 9 or Column < 0 or Column > 9:
Valid = False
However, I was trying to to make that smaller by doing something along the lines of:
"If (Row or Column) < 0 or (Row or Column) > 0:
valid = False"
Can someone explain why it doesn't seem work and can someone please demonstrate how they would solve it. I am only trying to slim down my if statements since throughout the assessment I will be using a large amount of them.
Update:- Can this also be put into a Try - Catch so it wouldn't crash the program upon entering a Null Value or No value
Thanks