巩固昨天,迎接明天

random

'''import random
b=random.randint(20,40)
a=3
while a>0:
    anwer=input("请输入你的内容")
    anwer=int(anwer)
    if anwer==b:
        print("老哥,稳如老狗呀")
    else:
        if anwer<b:
            print("老哥,你的貌似有点小了,注意保养哦")
        else:
            print("老哥,那么大,不合适吧!")
            a=a-1'''



'''======================='''




"""import random
wife=random.randint(520,1314)
while wife>1000:
    print("没事救多多在一起")
else:
    print('偷人去')"""







'''import random
anwer=random.randint(100,520)
a=200
while a>anwer:
    print("学python不用说都能找到女朋友")
    break
else:
    if a==anwer:
        print("你还没有领悟到python的精髓")
    else:
        print("python学过头了,会上火的")'''

'''=================='''
import random
anwer=random.randint(10,100)
count=5
while count>=0:
   temp= input("请输入你的信息")
   temp=int(temp)
   if anwer==temp:
       print("老哥,百步穿杨呀")
   else:
       if anwer<temp:
           print("哥们,你这有点过火了呀")
       else:
           print("老板,熟练度还欠缺哦")
           count=count-1

数字类型

1:地板除---//取比目标结果最小的整数

'''a=20
b=11
print(a//b)'''


'''a=50
b=2
print(a//b)'''


'''a=-20
b=11
print(a//b)   //(地板除)取比目标结果最小的整数,如1.5取1     -2.5取-3'''



''''a=20
b=15
print(divmod(a,b))'''

'''a,b=20,19
print(divmod(a,b))'''


'''a=100
b=-100
print(divmod(a,b))'''
#divmod==表示的是两个数的地板除以及余数

divmod-----取两个数的地板除和余数

绝对值

abs---表示绝对值

'''a=12
b=-12
c=-20
print(abs(a))
print(abs(b))
print(abs(c))'''


'''a=20
b=-20
print(a==abs(b))'''
#abs-表示一个数的绝对值

print(pow(2,3))
print(pow(2,3,5))
#pow(2,3)表示2的三次方,pow(2,3,5)表示2的三次方在除以5的余数

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值