I am writing a piece of software that checks the input to a function before passing it to a database. To do this I need to check the type of data before I send it. Right now I am using 5 different if/else statements. How can I condense this and make it easier to read? Thank You!
def addUser(USERNAME, PASSWORD, PHONE, CARRIER, SERVER): good = True if type(USERNAME) == str and good: good = True else: good = False if type(PASSWORD) == str and good: good = True else: good = False if type(PHONE) == int and good: good = True else: good = False if type(CARRIER) == str and good: good = True else: good = False if type(SERVER) == str and good: good = True else: good = False