0

I am trying to determine whether a variable is an integer or not.

I have a variable called arg2 and I need to determine whether arg2 is an integer. If arg2 is not an integer then it will set the value to 0.

How would I determine whether arg2 is an integer or not?

Ch3steR
  • 20,090
  • 4
  • 28
  • 58
verumIgnis
  • 160
  • 17

1 Answers1

-1

You can test arg2 type this way:

if (type(arg2) != int):
    arg2=0
Malo
  • 1,233
  • 1
  • 8
  • 25