"""
幼儿园加减法练习题
答对点赞表情,答错炸弹表情
表情随机出现
如果全答对有大奖
"""
import random
df=0
#定义答对函数
def dd():
    global df
    df+=10
    bq=["🌹🌹🌹","🎉🎉🎉","✔✔✔","👍👍👍","🍭🍭🍭"]
    ranbq=random.choice(bq) #使用随机取值的choice()函数
    print(ranbq)
#定义答错函数
def dc():
    bq=["👎","😭","😡","🥀","💣"]
    ranbq=random.choice(bq)
    print(ranbq)
print("幼儿园加减法。(共10题,每题10分)")
t1=int(input("5+6="))
if t1==5+6:
    dd()
else:
    dc()
t2=int(input("5+9="))
if t2==5+9:
    dd()
else:
    dc()
t3=int(input("5+12="))
if t3==5+12:
    dd()
else:
    dc()
t4=int(input("15+4="))
if t4==15+4:
    dd()
else:
    dc()
t5=int(input("1+8="))
if t5==1+8:
    dd()
else:
    dc()
t6=int(input("14+3="))
if t6==14+3:
    dd()
else:
    dc()
t7=int(input("17+3="))
if t7==17+3:
    dd()
else:
    dc()
t8=int(input("13+5="))
if t8==13+5:
    dd()
else:
    dc()
t9=int(input("9+11="))
if t9==9+11:
    dd()
else:
    dc()
t10=int(input("6+12="))
if t10==6+12:
    dd()
else:
    dc()
if df==100:
    print("""
全答对得分:100分
   💖💖💖💖💖💖💖💖💖💖💖
💖💗💗💖💖💖💖💖💓💓💕💕💕💔
🍗🍖🍗🍗🍗🍗🍗🍗🍗
    
    """)
运行结果:

知识点:
- 模块的基本导入方法和使用
- 函数的基本语法和调用
- 使用随机函数随机获取列表元素
- 全局变量和局内变量的使用规则,如局内转全局,变量前面要加global 关键字
- 以及input,if判断的结合使用



















