I am trying to write a function that checks whether or not variables a
and s
are of type int or float, if not it prints the print statement below. The if function does not work however how would I be able to fix it?
a = 2
s= "hello"
if ((type(a) not (float or int)) and (type(s) not (float or int))):
print(f'Invalid a type:{type(a)} s type: {type(s)}\Make sure to use float or int as for a and s values
Aucun commentaire:
Enregistrer un commentaire