2的指数
0000 0010 0000 0001
0000 0100 0000 0011
0000 1000 0000 0111
0001 0000 0000 1111

100：提示满分
90~100：优秀
80~100：良好
70~80：还可以，多多努力
60~70：合格
0~60：不合格
0：鸡蛋

num1=10
num2=20
print("交换前：num1=%s,num2=%s"%(num1,num2))
num1,num2=num2,num1
print("交换后：num1=%s,num2=%s"%(num1,num2))

n=int(input("请输入一个数："))
if n&(n-1)==0:
print("是2的指数")
else:
print("不是2的指数")

g=int(input("请输入成绩："))
if g==100:
print("\t满分")
elif 90 <= g <100:
print("\t优秀")
elif 80 <= g <90:
print("\t良好")
elif 70 <= g <80:
print("\t还可以，多多努力")
elif 60 <= g <70:
print("\t合格")
elif 0 <= g < 60:
print("\t不合格")
else :
print("请重新输入:")

num3=int(input("请输入一个数："))
if num3%2==0:
print("偶数")
elif num3!=0:
print("奇数")
else :
print("非奇非偶")

l=int(input("请输入矩形的长："))
w=int(input("请输入矩形的宽："))
area=l*w
cir=l+w
print("矩形的面积为：%s"%(area))
print("矩形的周长为：%s"%(cir))

day=int(input("请输入今天的天数："))
rem=31-day
print("剩余天数：%s"%(rem))
if day==1&day==2&day==3&day==4&day==5&day==6&day==7:
print("这是第一周")
elif day==8&day==9&day==10&day==11&day==12&day==13&day==14:
print("这是第二周")
elif day==15&day==16&day==17&day==18&day==19&day==20&day==21:
print("这是第三周")
elif day==22&day==22&day==23&day==24&day==25&day==26&day==27:
print("这是第四周")
elif day==29&day==30&day==31:
print("这是第五周")
else:
print("请你重新输入天数：")

print("圆的面积：%s"%(s))
print("圆的周长：%s"%(l))

GitHub

Gitee