I have a function which takes in 3 arguments and I want to make sure those three arguments are numbers.
As of right now, I've made this after a bit of experimenting and it seems to work but I'm not sure since I don't really understand the priority/precedence of boolean operators
assert type(x)==type(y)==type(z) in (int, float), "Please provide numbers"
What I'm looking for is:
- confirmation of my code working or not
- is there a better way to do it ? (I'm kinda new so maybe I'm missing something evident and well known :/)
the == operator has higher precedence than the in operator:
everything else looks good to me.