题型:综合题 题类: 难易度:困难
浙江省A9协作体2023-2024学年高二下学期信息技术期中联考试卷
①在电脑端输入出题数量n,依次生成 n道题目,每道题随机给出乘法或加法。
②每回答一道题时,若正确,则在 micro:bit端 LED阵列显示“笑脸”,否则显示“哭脸”。
③答完n道题目后,电脑端显示共练习了几道题,其中有几题回答正确。
电脑端程序:
import random
import serial
ser=serial.Serial()
ser.baudrate=115200
ser.port="COM4"
ser.open()
c=0;i=1
n=int(input("请输入题目数量:"))
while i<=n:
r=random.randint(0,1)
if r==0:
a=random.randint(1,9)
b=random.randint(1,9)
print(str(a)+"×"+str(b)+"=")
else:
a=random.randint(10,99)
b=random.randint(1099)
while ①____:
a=random.randint(10,99)
b=random.randint(10,99)
print(str(a)+"+"+str(b)+"=")
ans=int(input("请输入答案:"))
if r==0 and a*b==ans or r==1 and a+b==ans:
ser.write("H".encode())
c=c+1
else:
ser.write("S".encode())
i=i+1
print("共练习了"+str(n)+"题,其中有"+str(c)+"题回答正确。")
micro:bit端程序:
from microbit import *
while True:
if uart.any():
incoming=str(uart.read(),"UTF-8")
if :
display.show(Image.HAPPY)
else:
display.show(Image.SAD)
序号 | 访问地址 | 功能说明 |
1 | / | 主页,口算练习主要页面 |
2 | /login | 登录页,校对输入的用户名和密码是否正确。如正确则跳转到主页。 |
3 | /history | 历史记录页,显示用户自己答题的记录。 |
4 | /wrong | 错题页,显示用户自己错误的题目及高频错题。 |
根据网站页面规划,至少需要设计个视图函数。其中,访问错题页的URL是http://。
表1 某高校学考等级成绩折算表
学业水平考试等级 | A | B | C | D |
成绩折算(分) | 10 | 8 | 6 | 4 |
表2 某学生学考等级成绩单
科目 | 语文 | 数学 | 英语 | 物理 | 化学 | 生物 | 政治 | 历史 | 地理 | 技术 |
等级 | A | A | A | A | A | B | A | C | B | A |
编写Python程序实现学考成绩总分折算。表2学生的折合分数如图所示。
a=[i for i in range(1,7)] b=[0]*6 head, tail=0,0 for i in range(1,7): cnt=1 while cnt<i: a[tail]=a[head] head=(head+1)%6 tail=(tail+1)%6 cnt+=1 b[a[head]- 1]=i head=(head+1)%6 |
执行该程序段后, b[5]的值为( )
试题篮