#695. 初赛测试题(小高)1

初赛测试题(小高)1


选择题

  1. 定义非遗苏绣针法字典embroidery = {"平针":5, "打籽针":8, "盘金针":12},执行print(embroidery["盘金针"])的结果是() {{ select(1) }}
  • 5
  • 12
  • 报错
  • 8
  1. 非遗木雕工坊每日产量列表output = [78,85,92,88,90],执行sorted(output, reverse=True)后,第一个元素是() {{ select(2) }}
  • 78
  • 92
  • 85
  • 90
  1. 执行语句for i in range(3, 9, 2): print(i),不会输出的数字是() {{ select(3) }}
  • 3
  • 9
  • 5
  • 7
  1. 定义非遗糖画制作工具元组tools = ("铜勺", "石板", "糖稀", "剪刀"),下列操作正确的是() {{ select(4) }}
  • tools[2] = "麦芽糖"
  • tools.remove("剪刀")
  • print(len(tools))
  • tools.append("竹签")
  1. 非遗扎染工坊二维数据dye = [[200,5],[300,8],[250,6]],表示(染料用量,制作件数),dye[2][1]的值是() {{ select(5) }}
  • 250
  • 6
  • 300
  • 8
  1. 执行
     try:
       print(int("非遗")) 
     except ValueError: 
       print("输入错误")`
    
    ,输出结果是() {{ select(6) }}
  • 非遗
  • 0
  • 输入错误
  • 报错
  1. 非遗戏曲列表opera = ["京剧", "越剧", "昆曲", "豫剧", "黄梅戏"],执行opera[-3]的结果是() {{ select(7) }}
  • 昆曲
  • 越剧
  • 京剧
  • 豫剧
  1. 非遗竹编工坊产量字典prod = {"周一":75, "周二":82, "周三":78, "周四":85},获取所有值的和的正确代码是() {{ select(8) }}
  • sum(prod.keys())
  • len(prod)
  • sum(prod)
  • sum(prod.values())
  1. 列表paper_cut = [120, 150, 180, 130],执行paper_cut.pop(2)后,列表的长度是() {{ select(9) }}
  • 4
  • 3
  • 5
  • 2
  1. 二维数据craftsman = [["李师傅",95,90],["王师傅",88,92],["张师傅",92,89]],表示(姓名,上午产量,下午产量),获取王师傅下午产量的写法是() {{ select(10) }}
  • craftsman[1][2]
  • craftsman[2][1]
  • craftsman[0][2]
  • craftsman[1][1]
  1. 定义非遗剪纸价格字典price = {"窗花":15, "福字":20, "生肖":25},修改福字价格为22的正确语句是() {{ select(11) }}
  • price.add("福字",22)
  • price[福字] = 22
  • price.set("福字",22)
  • price["福字"] = 22
  1. 非遗陶艺烧制时间列表time = [1.5, 2.0, 1.8, 2.2, 1.6],计算平均烧制时间的正确代码是() {{ select(12) }}
  • sum(time)*len(time)
  • sum(time)/len(time)
  • (max(time)-min(time))/2
  • max(time)+min(time)
  1. 执行语句
    i=0; 
    while i<4: 
      i+=1; 
      if i==3:
        break;
      print(i)
    
    ,最后输出的i是() {{ select(13) }}
  • 3
  • 2
  • 0
  • 4
  1. 定义非遗文创列表cultural = ["皮影", "刺绣", "陶艺", "木雕"],判断"竹编"是否在列表中的正确语句是() {{ select(14) }}
  • cultural.index("竹编")
  • cultural.find("竹编")
  • cultural in "竹编"
  • "竹编" in cultural
  1. 非遗工坊采购宣纸x=450张,分发给9个匠人,执行x//9的结果是() {{ select(15) }}
  • 50
  • 45
  • 50.0
  • 9

判断题

  1. Python中元组的元素可以进行修改和删除操作。() {{ select(16) }}
  1. 二维数据可以用列表的列表来表示,通过双层索引可以访问具体元素。() {{ select(17) }}
  1. try-except异常处理结构中,except块可以捕获并处理try块中出现的程序错误。() {{ select(18) }}
  1. Python中字典的键可以重复,值不可以重复。() {{ select(19) }}
  1. for循环中使用continue语句可以终止整个循环的执行。() {{ select(20) }}