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
  • 19,076
  • 4
  • 25
  • 52
verumIgnis
  • 160
  • 15

1 Answers1

-1

You can test arg2 type this way:

if (type(arg2) != int):
    arg2=0
Malo
  • 1,136
  • 1
  • 5
  • 23