1.10 python learning record

#continue and break
#continue    To end this circulation and start next circulation. 
'''
about tab
eg.
for i in range(1,100):                 -----1
    setense 1
    for q in range(1,100):             -----2
        setense 2
        continue
        setense 3
    setense4

in this case the setense 3 is useless
if u want to end C1,u should use just one tab and put it behind S1.
'''
#break when meet with break,the whole circulation is over.(just this round)

money = 10000
#对员工用for循环发工资
for i in range(1,21):
    # 导入随机数 注意这个随机数放在里面才能每次都不一样 如果放在前面就只有一个结果。
    import random
    score = random.randint(1, 10)
    if score < 5:
        print(f'员工{i},绩效分{score},低于5,不发工资,下一位。')
    elif score >= 5:
        money -= 1000
        print(f'向员工{i}发放工资1000元,账户余额还剩{money}元。')
    if money == 0:
        print(f'工资发完了,下个月领取吧。')
        break

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值