G'day fellows. I face a problem regarding a global variable which python claims is not defiend even though it is. In essence, I just want to check if an integer contains a decimal place, or the input contains nothing integer related whatsoever. Here is my code:
def Strength1():
    try:
        global strength1
        strength1 = int(input("%s, please enter your desired strength - between 1 and 20\n>"%name1))
        strength1int = int(strength1)
        def invLoop():
            clearScreen()
            Invalid()
            Strength1()
        if int(strength1) <= 0:
            invLoop()
        if int(strength1) >= 21:
            invLoop()
    except Exception as exception:
        clearScreen()
        print("'%s isn't an integer."%strength1)
        Strength1()
def Skill1():
    try:
        global skill1
        skill1 = int(input("%s, please enter your desired skill - between 1 and 20\n>"%name1))
        skill1int = int(skill1)
        def invLoop():
            clearScreen()
            Invalid()
            Skill1()
        if int(skill1) <= 0:
            invLoop()
        if int(skill1) >= 21:
            invLoop()
    except Exception as exception:
        clearScreen()
        print("'%s isn't an integer."%skill1)
        Skill1()
def Strength2():
    try:
        global strength2
        strength2 = int(input("%s, please enter your desired strength - between 1 and 20\n>"%name2))
        def invLoop():
            clearScreen()
            Invalid()
            Strength2()
        if int(strength2) <= 0:
            invLoop()
        if int(strength2) >= 21:
            invLoop()
    except Exception as exception:
        clearScreen()
        print("'%s' isn't an integer."%strength2)
        Strength2()
def Skill2():
    try:
        global skill2
        skill2 = int(input("%s, please enter your desired skill - between 1 and 20\n>"%name2))
        def invLoop():
            clearScreen()
            Invalid()
            Skill2()
        if int(skill2) <= 0:
                 invLoop()
        if int(skill2) >= 21:
                invLoop()
    except Exception as exception:
        clearScreen()
        print("'%s' isn't an integer."%skill2)
        Skill2()
and this is my error:
Traceback (most recent call last):
  File "H:\Toby Reichelt\A453\Two Encounters - Developing Dice.py", line 29, in Skill1
    skill1 = int(input("%s, please enter your desired skill - between 1 and 20\n>"%name1))
ValueError: invalid literal for int() with base 10: '0.5'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "H:\Toby Reichelt\A453\Two Encounters - Developing Dice.py", line 197, in <module>
    mainloop()
  File "H:\Toby Reichelt\A453\Two Encounters - Developing Dice.py", line 188, in mainloop
    Skill1()
  File "H:\Toby Reichelt\A453\Two Encounters - Developing Dice.py", line 41, in Skill1
    print("'%s isn't an integer."%skill1)
NameError: global name 'skill1' is not defined
 
     
     
     
     
    