题解 | #自动售卖饮料机#
自动售卖饮料机
http://www.nowcoder.com/practice/a1f001becb0248c1a264c6643d0d640c
NP34 自动售卖饮料机
思路:
step1:定义输入;打印所需语句;
step2:判断并输出对应语句;
代码如下:
kind_of_drink = input()
print('What kind of drink would you like?' )
if kind_of_drink == 'cola':
print( 'Below is your cola. Please check it!')
else:
print('The {} has been sold out!'.format(kind_of_drink))