私はPythonで何かを作成するプログラミングクラスのプロジェクトを持っており、私はpokedexを作ることにしました。私は1の入力を与えるときにそれが何も返さないポケベルを求めるとき、なぜわからないのですか?Python変数が印刷されない
import random
import time
print "Hello new Trainer!"
time.sleep(1.6)
print "I am your Kanto region Pokédex"
time.sleep(2.3)
print "Please enter your name below so I may know what to call you."
time.sleep(2)
name = raw_input("Name:")
time.sleep(1)
print "Hello %s, it is nice to meet you" % (name)
time.sleep(2)
print "I am a Pokédex, a Pokédex is a database of Pokémon."
time.sleep(3)
print "This Pokédex is specific for Pokémon in the Kanto region."
time.sleep(3.5)
print "All Pokémon have an assigned number that corresponds to that certain Pokémon species"
time.sleep(4)
print "For example, Pikachu is the 25th entry in the Pokédex!"
time.sleep(3)
print "When you enter a Pokémon's # it will bring up all available information on that Pokémon"
time.sleep(5)
print "Please enter a number between 1 and 151 to learn about the Pokémon associated to that number."
Bulbasaur = "Bulbasaur can be seen napping in bright sunlight. There is a seed on its back. By soaking up the sun's rays, the seed grows progressively larger."
userpoke = raw_input("Pokémon #:")
def userpoke():
if userpoke == 1:
print (Bulbasaur)
同じ名前の変数と関数があります。 –
diff関数名を持っていなければなりません。最後にコールする必要があります。また、 'string'を' raw_input'の 'int'にキャストする必要があります。 – Devansh
あなたは今ここで質問をする前に、教材を見直す必要があると言っています。 – TigerhawkT3