Chapter 3 confirm
print("今有物不计其数,三三数之剩二,五五数之剩三,七七数之剩二,问几何?\n")
number = int(input("请输入您认为正确的数,:"))
if number%3 == 2 and number%5 == 3 and number%7 == 2:
print(number,"您输入的数符合要求")
Chapter 3 confirm 2
print("今有物不计其数,三三数之剩二,五五数之剩三,七七数之剩二,问几何?\n")
number = int(input("请输入瑛姑给出的数:"))
if number%3 == 2 and number%5 == 3 and number%7 == 2:
print("她给的的数符合要求")
else:
print("她给的数不符合要求")
Chapter 3 confirm 3
print("今有物不计其数,三三数之剩二,五五数之剩三,七七数之剩二,问几何?\n")
none = True
number = 0
while none:
number += 1
if number%3 == 2 and number%5 == 3 and number%7 == 2:
print(number,"您输入的数符合要求")
none = False
Chapter 3 confirm 4
print("今有物不计其数,三三数之剩二,五五数之剩三,七七数之剩二,问几何?\n")
for number in range(1,100):
if number%3 == 2 and number%5 == 3 and number%7 == 2:
print("是这个数",number)
Chapter 3 confirm 5
print("今有物不计其数,三三数之剩二,五五数之剩三,七七数之剩二,问几何?\n")
for number in range(100):
if number%3 == 2 and number%5 == 3 and number%7 == 2:
print("是这个数",number)
break
Chapter 3 slap every 7
total = 99
for number in range(1,100):
if number%7 == 0:
continue
else:
string = str(number)
if string.endswith('7'):
continue
total -= 1
print("从1到100共拍腿",total,"次")
Chapter 3 the meaning of rose
print("在古希腊文化中,玫瑰集爱情与美丽于一身,所以人们常用玫瑰来表达爱情")
print("但是不同的数量的玫瑰花所表达的含义是不一样的\n")
number = int(input("输入你想送的花朵数量:"))
if number == 1:
print("你是我的唯一")
elif number == 3:
print("I LOVE YOU")
elif number == 10:
print("十全十美")
elif number == 99:
print("天长地久")
elif number == 108:
print("求婚!")
else:
print("那我也不知到了,你试试别的数字吧")
Chapter 3 9 multiply by 9
for i in range(9,10):
for j in range(9,i-1):
print(str(j)+"×"+str(i)+"="+str(i*j)+"\t",end = ' ')
print('')
Chapter 3 9 multiply by 9 (2
for i in range(1, 10):
for k in range(1, i):
print(end=" ")
for j in range(i, 10):
print("%d%d=%2d" % (i, j, ij), end=' ')
print('\n')
Chapter 3 Alipay
import sys
sum = 0
count = 1
print("查询能量请输入能量来源!,退出程序请按0")
while (count <= 30) :
num = str(input(""))
if num == "0" :
print("已退出")
sys.exit(1)
if num == "生活缴费" :
print("200g\n")
sum += 200
print("您的能量为:"+str(sum)+"g")
count += 1
if num == "行走捐" :
print("250g\n")
sum += 250
print("您的能量为:"+str(sum)+"g")
if num == "共享单车" :
print("230g\n")
sum += 230
print("您的能量为:"+str(sum)+"g")
if num == "线下支付" :
print("130g\n")
sum += 130
print("您的能量为:"+str(sum)+"g")
if num == "网络支付" :
print("235g\n")
sum += 235
print("您的能量为:"+str(sum)+"g")
Chapter 3 guess number
import random
number = random.randint(1,10)
print("-----猜数字游戏-----")
print("请输入1~10中任意一个数")
count = 1
while count <= 5 :
guess = int(input(" "))
if guess < number :
print("小了,请重新输入")
if guess > number:
print("大了,请重新输入")
if guess == number :
print("恭喜你,猜中了,数字是" + str(number))
print("-----游戏结束-----")
break
Chapter 3 jump 1 jump
import sys
print("-----跳一跳-----")
print("欢迎回来,请开始游戏,退出游戏请按0")
print("请输入(中心、音乐块、微信支付块)")
count = 1
sum = 0
while count < 10 :
num = str(input(""))
if num == "中心" :
sum += 2
print("您的分数是:" + str(sum) + "分")
if num == "音乐块" :
sum += 30
print("您的分数是" + str(sum) + "分")
if num == "微信支付快" :
sum += 20
print("您的分数是" + str(sum) + "分")
if num == "0" :
print("已退出游戏")
sys.exit(1)
Chapter 3 10086
print("--------10086查询功能--------")
print("\n")
print("输入1,查询当前余额")
print("输入2,查询当前剩余流量")
print("输入3,查询当前剩余通话时间")
print("输入0,退出自助查询系统")
import sys
import random
a = random.randint(0, 114)
b = random.randint(0, 514)
c = random.randint(0, 500)
while 1 :
num = str(input())
if num == "1" :
print("您的余额为:" + str(a) + "元")
if num == "2" :
print("您的剩余流量为" + str(b) + "G")
if num == "3" :
print("您的剩余通话时间为" + str(c) + "分钟")
if num == "0" :
print("已退出自助查询系统")
sys.exit(1)