This code perfectly works if the player inputs a valid / defined input on the first try. If the input is not correct (For example "theif" or "Warrior") the function will be called again. However that second (or third,...) time will always return null although that 2nd time the input was correct.
(This is just a part of the program)
def classDecider():
print("Available Classes: Swordsman, Magician, Thief")
enteredClass = input("Enter Class: ")
if enteredClass == "Swordsman":
return "Swordsman"
elif enteredClass == "Magician":
return "Magician"
elif enteredClass == "Thief":
return "Thief"
else:
classDecider()
def CharacterCreation():
nameOfPlayer = input("Enter your name: ")
chosenClass = classDecider()
print(chosenClass)
players.append(player(nameOfPlayer, chosenClass))
chosenCharacter +=1
CharacterCreation()