National Youth Electronic Information Intelligence Innovation Competition
python · Compulsory questions simulation volume two
1. Multiple Choice Questions
1. What is the programming environment that comes with Python? ( )
A、PyScripter
B、Spyder
C、Notepad++
D、IDLE
Question type: multiple choice
Answer: D
Difficulty: Normal
Analysis of test questions:
2. Which statement about the following code is correct? ( )
t = int(turtle.textinput('Number of sides', 'How many polygons:'))
turtle.circle(50, steps=t)
turtle.done()
A. circle is the code for drawing a circle, so the pattern after running the program must be a circle
B. After running the program, the user needs to input the number of sides and determine to draw the "polygon"
C. The variable t does not give a specific value, so the program runs incorrectly
D. After the program runs, 50 circles will be drawn
Question type: multiple choice
Answer: B
Difficulty: Normal
Analysis of test questions:
3. What is the exponentiation operator? ( )
A、*
B、*+
C、**
D、/
Question type: multiple choice
Answer: C
Difficulty: Normal
Analysis of test questions:
4. What is the result of running this code? ( )
import turtle
g = turtle.Pen()
g.fillcolor("red")
g.begin_fill()
g.circle(50)
g.pencolor("yellow")
g.fillcolor("green")
g.circle(50, steps=5)
g.end_fill()
Question type: multiple choice
Answer: A
Difficulty: difficult
Analysis of test questions:
5. Suppose a=20, b=3, what is the result of a or b? ( )
A、20
B、0
C、1
D、3
Question type: multiple choice
Answer: A
Difficulty: difficult
Analysis of test questions:
6. Suppose a=2, b=3, what is the value of ab*b? ( )
A、-3
B、-2
C、-7
D、-11
Question type: multiple choice
Answer: C
Difficulty: difficult
Analysis of test questions:
7. Which of the following options does not conform to the Python variable naming rules? ( )
A、name
B、2_to
C、_Go
D、Tea
Question type: multiple choice
Answer: B
Difficulty: Normal
Analysis of test questions:
8. Create a new Python program and write the following code
import turtle
turtle.shape("turtle")
Save the Python file and give it a name.
Which of the following filename programs would work correctly? ( )
A、frist.py
B、turtle.py
C、import. py3
D. hao.sb2
Question type: multiple choice
Answer: A
Difficulty: Normal
Analysis of test questions:
9. a="110", b="9", c=a+b, what is the result of print(c)? ( )
A、a+b
B、119
C、c
D、1109
Question type: multiple choice
Answer: D
Difficulty: Normal
Analysis of test questions:
10. What is the exit command of IDLE environment? ( )
A、esc()
B、close()
C. Enter key
D、exit()
Question type: multiple choice
Answer: D
Difficulty: Normal
Analysis of test questions:
11. Which symbol is used to represent the integer division operator in Python? ( )
A、\
B、//
C、%
D、**
Question type: multiple choice
Answer: B
Difficulty: Normal
Analysis of test questions:
12. After executing the statement x,y=9%5,8//3, what are the values of variables x and y? ( )
A、1.8,2
B、1,2.66666
C、4,2
D、1,2
Question type: multiple choice
Answer: C
Difficulty: difficult
Analysis of test questions: This question examines arithmetic operations and assignment statements. % is to take the remainder, // means divisible.
13. What is the correct way to comment in Python? ( )
A,//This is my first program
B. The function of the #program is to input Hello World
C. ? This program is used to calculate the sum of two numbers?
D. **The first python program**
Question type: multiple choice
Answer: B
Difficulty: Normal
Analysis of test questions:
14. What does == represent in Python? ( )
A. Assign the value on the left to the right;
B. Assign the value on the right to the left;
C. Compare whether the left and right sides are equal;
D. The values on the left and right sides are exchanged;
Question type: multiple choice
Answer: C
Difficulty: Normal
Analysis of test questions:
15. Which part of the following code is to set the color of the canvas? ( )
import turtle
turtle.screensize(①,②,③)
A、①
B、②
C、③
D. neither
Question type: multiple choice
Answer: C
Difficulty: Normal
Analysis of test questions:
16. Which of the following lines of code does not output Python3.7? ( )
A、print(“Python3.7”)
B、print(“Python”+3.7)
C、print(“Python”+str(3.7))
D、print(“Python”+“3.7”)
Question type: multiple choice
Answer: B
Difficulty: difficult
Analysis of test questions:
17. What kind of graph does the following program draw? ( )
import turtle
turtle.forward(100)
turtle.left(120)
turtle.forward(100)
turtle.left(120)
turtle.forward(100)
turtle.left(120)
A. Equilateral triangle
B. Square
C. Rectangular
D. round
Question type: multiple choice
Answer: A
Difficulty: Normal
Analysis of test questions:
18. Use the ( ) function below to receive the input data.
A、accept()
B、input()
C、readline()
D、login()
Question type: multiple choice
Answer: B
Difficulty: Normal
Analysis of test questions:
19. What are the colors defined in the turtle.color("red", "yellow") command? ( )
A. The background is yellow and the brush is red
B. The background is red and the brush is yellow
C. The brush is red and the fill is yellow
D. The brush is yellow and the fill is red
Question type: multiple choice
Answer: C
Difficulty: Normal
Analysis of test questions:
20. What is the function of print? ( )
A. Print the corresponding text or numbers on the screen
B. Print relevant text or numbers in the printer
C. can be used for drawing
D. Output a command line
Question type: multiple choice
Answer: A
Difficulty: Normal
Analysis of test questions:
21. Which of the following commands is not a command to move the position of the brush arrow? ( )
A、turtle.forward()
B、turtle.goto()
C、turtle.color()
D、turtle.right ()
Question type: multiple choice
Answer: C
Difficulty: Normal
Analysis of test questions:
22. a=2, b=3, then what is the result of c=a**b operation? ( )
A、6
B、8
C、9
D、23
Question type: multiple choice
Answer: B
Difficulty: Normal
Analysis of test questions:
23. Use the Python brush to draw the pattern shown in the figure below, how should the code in line 4 be supplemented? ( )
A、p.right(90)
B、p.left(90)
C、p.right(-90)
D、p.left(-180)
Question type: multiple choice
Answer: A
Difficulty: Normal
Analysis of test questions:
24. Among the following operators, which one is the highest in terms of operational precedence? ( )
A、**
B、*
C、+
D、
Question type: multiple choice
Answer: A
Difficulty: Normal
Analysis of test questions:
25. Which option should I choose to create a new Python file as shown in the figure? ( )
A、Open
B、Recent Files
C、New File
D、Print Window
Question type: multiple choice
Answer: C
Difficulty: Normal
Analysis of test questions: