|
|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
available_toppings = ['mushrooms','olives','green peppers',
'pepperoni','pineapple','extra cheese']
requested_toppings = ['mushrooms','french fries','extra cheese']
for requested_topping in requested_toppings:
if requested_topping in available_toppings:
print('Adding' + requested_topping + '.')
else:
Print("Sorry,we don't have" + requested_topping + '.')
print('\nFinished making your pizza!')
如下显示
Traceback (most recent call last):
File "C:/Users/Administrator/Desktop/22.py", line 8, in <module>
Print("Sorry,we don't have" + requested_topping + '.')
NameError: name 'Print' is not defined
不知道哪里错了,谁能帮忙指出来,谢谢
- Print("Sorry,we don't have" + requested_topping + '.')
复制代码
这一行的 print 的 p 是小写,不是大写。
|
|