[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
#两个数交换,要求使用异或法完成 number1=int(input("请输入第一个数:")) number2=int(input("请输入第二个数:"))
number2=number1^number2 number1=number1^number2 number2=number1^number2 print(
'number1=%d\nnumber2=%d' %(number1,number2)) #判断一个数,是否是2的指数 number=int(input(
'请输入判断的数:')) if number&(number-1)==0: print('这个数是2的指数') else: print('这个数不是2的指数')
#给定成绩,判断用户成绩的档次 results=int(input('请输入成绩:')) if results==100: print('满分') elif
results>=90 and results<100: print('优秀') elif results>=80 and results<90: print(
'良好') elif results>=70 and results<80: print('还可以,多多努力') elif results>=60 and
results<70: print('合格') elif results>0 and results<60: print('不合格') elif results
==0: print('鸡蛋') else: print('输入无效成绩') '''在控制台上,输入如下信息 a a^2 a^3 1 1 1 2 4 8 3
9 27 ''' n=[] for i in range(0,4): n.append(list(map(str,input().split(' '))))
#作业8:判断一个整数是奇数还是偶数,至少有两种方式实现(位运算已经讲解的话) #方法一 number=int(input('请输入一个整数:')) if
number%2==0: print('这个整数是偶数') else: print('这个整数是奇数') #方法二 number=int(input(
'请输入一个整数:')) if number&1==0: print('这个整数是偶数') else: print('这个整数是奇数')
#作业10:求矩形的面积和周长 long=float(input('矩形长为:')) wide=float(input('矩形宽为:')) print(
'矩形的面积为:%.4f' %(long*wide)) print('矩形的周长为:%.4f' %(2*(long+wide)))
#作业11:根据天数(从控制台上输入)计算周数和剩余的天数 day=int(input('请输入天数为:')) weeks=day//7 day1=day%7
print('周数为:%d\n剩余的天数为:%d' %(weeks,day1)) #作业12:
根据已知圆的半径radius(从控制台上输入),求其面积和周长(PI可以使用Math.PI,也可以使用3.14) PI=3.14 R=float(input(
'输入圆的半径:')) print('圆的周长:%.4f' %(2*PI*R)) print('圆的面积:%.4f' %(PI*R*R))