0

Int object not callable

I am trying to create a text based game character creation tool as part of a bigger project. The user enters input when asked and later on will be able to describe the character. But i am getting the int object not callable error on testing. Testing here in sololearn whil not work due to multiple inputs. The code is: def set_desc(): global race, clas, sex, age, height, weight, hair, eyes, skin print("Great! You are a " + (race) +" " + (clas) + "!") print('As you can see, I am blind. Can you please tell me if you are male or female. \n 1 for Male \n 2 for female') sex = int(input("Male or Female?: ")) if sex == 1: sex = "Male" elif sex == 2: sex = "Female" height = int(input("How tall are you in inches?:" )) weight = int(input("How much do you weigh?:" )) hair = str(input("What color is your hair?: ")) eyes = str(input("What color are your eyes?:" )) skin = str(input("And last, tell me about your skin?: ")) set_desc() It works until it gets to hair. Ideas greatly appreciated!

14th Dec 2018, 3:15 AM
Thomas Knight
Thomas Knight - avatar
2 Respostas
0
Actually no, I altered it from hair = str(input()) To Hair = input() And it works so i don't get that error now. But curious that it worked for you?
14th Dec 2018, 3:32 AM
Thomas Knight
Thomas Knight - avatar
- 1
Your code is working fine for me. Can you share the error message you’re getting?
14th Dec 2018, 3:30 AM
Diego
Diego - avatar