RPG를 만들려고하는데 게임에서 플레이어의 캐릭터 이름을 지정할 수 있습니다. 나는 그 이름이 정의되지 않았다고 말하면서 곤경에 처하게되었다. 파이썬 2 raw_input 이해하고, 그 문제가되지 않습니다, 나는 '입력'raw_input 그것을 전혀 작동하지 않습니다, 그것을 변경하면 그냥 프로그램이 끝날 것이라고 테스트했습니다. 그리고이 문제를 해결할 수있는 사람이 있는지 알고 싶습니다. input
이 평가 된 문자열을 반환 반면 파이썬 2에서플레이어 이름을 입력하는 방법은 무엇입니까?
import random
PN = 0
Hit = 0
health = 50
level = 0
EXP = 0
nameless_variable_1 = 0
print("Hello, and welcome to my creation!")
print("To begin type 1")
print("to see credits type 2")
print("to quit go to the X button in the corner and click it")
print("to continue type what you want to do and hit enter on your keyboard.")
nameless_variable_1 = input("what is your choice??????")
if nameless_variable_1 == 2:
print("................. The entire game")
print("do you want to play the game now?")
print("if you do press one and then hit enter")
nameless_variable_1 = input(" ")
if nameless_variable_1 == 1:
PN = input("what is your character Name?")
print("it is the year 2019 and you are trying to assasinate an important person")
print("if you fail at this task, you can and probably will die.")
질문이 있습니까? – MMF
내 문제에 대한 도움을 요청하고 있습니다. –
파이썬 2 또는 파이썬 3을 사용하고 있습니까? – ImportanceOfBeingErnest