I'm making a basic text adventure game for the first time in PyDev in Eclipse and when I try to have the user give input more than once I get the above error. Below is the code I used that generated the error:
print("Input a name for your character.")
input = input()
player = Character(input)
I already have the class Character defined and it takes a str as its argument. The setter is below.
player.setName(input)
print("\nWelcome, "+input+"!\nChoose a weapon from the list below.")
print("\nfists\ndagger\nspear\naxe\nshortsword\nlongsword\nmace")
wpn = input()
I get a TypeError on the line with wpn = input()" saying 'str' object is not callable.
This confuses me because, shouldn't this take input and store it in a new variable "wpn" where once it was stored in "input"? When I change wpn to input it works, but not if I ask it to take user input...
I want unique user inputs each time, but I'm not sure how to accomplish that given this error.
input. After that point, you can no longer callinput(), because that name no longer refers to the built-in function. Just choose a different variable name there.