擅长:python、mysql、java
<p>您在这里创建了三个独立的if语句。看一下附带的带括号的伪代码</p>
<pre><code>if(boot == n){
print('Nike, great choice')
}
if (boot == a){
print('Adidas, not my favorite')
}
if (boot == p){
print('Not sure about Puma')
}
else{
print('I am not familiar with that brand')
}
</code></pre>
<p>您需要使用“elif”:</p>
<pre><code>if boot == n:
print('Nike, great choice')
elif boot == a:
print('Adidas, not my favorite')
else:
print('I am not familiar with that brand')
</code></pre>