'''money=1000
s=int(input('请输入取款金额(整数):'))
if money>=s:
money-=s
print('取款成功,余额为:',money)
else:
print('余额不足,取款失败')'''
#判断是奇数还是偶数
'''num=int(input('请输入一个整数:'))
if num%2:
print(num,'is an odd')
else:
print(num,'is an even')'''
#Multi-branch score judgment
'''score=int(input('input your score:'))
if score>=90 and score<=100:
print('your score is level A')
elif score>=80 and score<90:
print('your score is level B')
elif score >= 70 and score < 80:
print('your score is level C')
elif score>=60 and score<70:
print('your score is level D')
elif score >= 0 and score < 60:
print('your score is level E')
else:
print('score is invalid')'''
#shopping amount judgment
answer=input('are you a VIP?y,Y/n,N')
if answer=='y' or answer=='Y':
amount=float(input('input your shopping amount:'))
if amount>=200:
print('20% off,the payment is:',amount*0.8)
elif amount>=100:
print('10% off,the payment is:',amount*0.9)
else:
print('NO discount,the payment is:',amount)
else:
amount = float(input('input your shopping amount:'))
if amount>=200:
print('5% off,the payment is:',amount*0.95)
else:
print('NO discount,the payment is:',amount)
另外:建议大家写代码都用英文。
我最近入手的方向是opencv图像处理,模式识别,希望有这方面的大佬多多指点。
我的主要学习资源来自B站
下面是链接
【花了2万多买的Python教程全套,现在分享给大家,入门到精通(Python全栈开发教程)】 https://www.bilibili.com/video/BV1wD4y1o7AS/?p=44&share_source=copy_web&vd_source=d72490d9fdaa25a931b4485c6317ef86