Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to create a variable that represents any integer in python

def integerCheck(x):
    if x < 0:
      y = -x
      if (y % 2 == True) or (y % 3 == True ):
        print( x, ' is an integer.')
      else:
        print(x, 'is not an integer')   
    elif x > 0:
       if (x % 2 == True) or (x % 3 == True ):
        print( x, ' is an integer.')
       else:
        print(x, 'is not an integer')
    else:
      print(x, 'is considered an integer') 

#Now you can check your number using integerCheck()      
    
 
PREVIOUS NEXT
Tagged: #create #variable #represents #integer #python
ADD COMMENT
Topic
Name
2+4 =