<p>我正在试验原始输入,除了我的第一条<code>if</code>语句和else语句外,它运行得很好。每当我运行代码并用第一条<code>if</code>语句中“League”后面列出的原始输入回答第二个问题时,它将同时返回第一个if的打印和else的打印,而它应该只打印第一个<code>if</code>。你知道怎么回事吗?在</p>
<pre><code>name = raw_input('What is your name?\n')
game = raw_input('\nWhat MOBA do you play/have played? \n(The answer ' \
'must be case sensitive i.e. LoL for League and DoTA for y\'know the whole darn thing '\
'is too '\
'darn long to say even though I typed a lot more than the name)\n')
if game in ('League' , 'League of Legends' , 'LoL'):
print '\nYou go girl! '
if game in ('DoTA' , 'DoTA 2' , 'DoTA2'):
print '\nThat\'s cool and all but........ Go play League you dang noob. '
else:
print '\nAre you kidding me? You play %s? I\'m severely disappointed in you %s. You ' \
'should at least be playing ' \
'one of these popular games. \nShame, shame, shame. Go install one. ' % (game, name)
</code></pre>