#P001. PY联赛一级

PY联赛一级

选择题

  1. 可以对Python代码进行多行注释的是? {{ select(1) }}
  • #
  • ""
  • ''' '''
  • ''
  1. 下列可以作为Python变量名的是? {{ select(2) }}
  • and
  • an-d
  • 1_and
  • and1
  1. 下列选项中,Python程序的扩展名是? {{ select(3) }}
  • scratch
  • doc
  • python
  • py
  1. 下列Python语句能够正确输出的是? {{ select(4) }}
  • print("天天快乐!")
  • print"(天天快乐!)"
  • print"天天快乐!"
  • print("天天快乐!')
  1. Python中如何计算得到8除以3的余数? {{ select(5) }}
  • 8%3
  • 8//3
  • 8?3
  • 8\3
  1. 在Python中,下面的赋值语句,正确的是? {{ select(6) }}
  • X+y=10
  • X-2=2y
  • x=30
  • 3y=x+1
  1. 在Python中,使用type()函数可以获取参数的数据类型,那么运行type("int")的运行结果是? {{ select(7) }}
  • <class 'int'>
  • <class 'str'>
  • <class 'float'>
  • <class 'bool'>
  1. 下列表达式的结果最大的是? {{ select(8) }}
  • 20%4
  • 20**2
  • 20*4
  • 20//4
  1. 假设a="吉祥";b="如意";c="a"+"b";print(c),请问输出结果是? {{ select(9) }}
  • 吉祥 如意
  • 吉祥如意
  • ab
  • a+b
  1. 在Python中,表达式6-3*2的结果是? {{ select(10) }}
  • 0
  • 6
  • 12
  • 1
  1. print("16+2")输出的结果是? {{ select(11) }}
  • "16+2"
  • 18
  • 162
  • 16+2
  1. 以下运算符中,运算优先级最高的是? {{ select(12) }}
  • <=
  • or
  • ==
  • %
  1. 下列哪个命令,可以将2024转换成'2024' 呢? {{ select(13) }}
  • str(2024)
  • int(2024)
  • float(2024)
  • bool(2024)
  1. Python计算100/2的结果是? {{ select(14) }}
  • 50.0
  • 50
  • 50.00
  • 200
  1. 假设a=0.7,b=0.3,c=a+b,那么c的值是? {{ select(15) }}
  • 1
  • 1.0
  • 1.00
  • 0.4