def choose_lang():
    lang = None # NOTE: this `lang` has nothing to do with the global `lang`
    while True: 
        try:
            lang = int(input("select (1 or 2)"))
        except ValueError:
            pass
        if lang not in [1, 2]:
            print("\ntry again")
        else:
            break
    return lang

lang = choose_lang()
c = 2 + lang
print(c)