0 votes
1 view
in Python by (47.8k points)
recategorized by

How would you write, in python:

if key < 1 or key > 34:

I've tried every way I can think of, and am finding it very frustrating.

1 Answer

0 votes
by (107k points)

The if keyword is not an int or float value but it is a string, you need to convert it to an int first by following ways:-

key = int(key)

or to a float by doing

key = float(key)

Related questions

0 votes
1 answer
0 votes
2 answers
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...