1) What would happen if we ran the following code? a) 3 separate lines of hi followed by 1 line of hello b) 1 line of hihihi followed by 1 lines of hellohellohello c) 1 line of hihihi followed by 1 line of hello d) 3 separate lines of hi hello 2) What is the term used to describe the small graphic that draws based on programming commands? a) A turtle b) Norman c) Tracy d) Pegman 3) What is Tracy? a) A Python program b) A Python command c) A name for the turtle used in Python programming 4) How would I tell Tracy to move forward 100 pixels? a) go (100px) b) forward(100) c) forward 100 d) move_forward (100px) 5) What value is represented inside the parentheses for this command: circle(20)? a) The diameter of the circle b) The center coordinates of the circle c) The radius of the circle d) The width of the circle 6) Where does Tracy always start in the grid? a) At (0,0) in the bottom left of the grid b) At (0,0) in the center of the grid c) At (200, 200) in the top right of the grid d) At (-200, 200) in the center of the grid 7) What are the dimensions of the grid world? a) 200 x 200 pixels b) 400 x 200 pixels c) 400 x 400 pixels d) 200 x 400 pixels 8) Which command(s) would move Tracy backward 100 pixels? a) backward(100) b) forward(100) c) forward(-100) d) backward(100 px) 9) How far does Tracy need to go from the starting point to reach the right side of the grid/canvas? a) 100 pixels b) 400 pixels c) 200 pixels 10) If you want Tracy to move forward without drawing a line, how should you write the commands? a) line 1 penup(), line 2 foward(100) b) line 1 penup(100), line 2 forward() c) line 1 forward(100), line 2 penup() d) line 1 forward(penup(100)) 11) If Tracy is facing to the right (East)where would she be facing after the command: left(180)? a) left b) West c) East d) up(North) 12) The following loop draws 3 circles on the screen. If I wanted to draw 10 circles, how many lines would my code be? a) 10 lines b) 3 lines c) 30 lines 13) Unless Tracy is given a set position, where does she start drawing on the canvas? a) In the middle b) From the bottom left c) From the top left 14) If Tracy is given the command: forward(50), how many times will it need to repeat to get to the right edge of the grid? a) 1 time b) 10 times c) 4 times d) 2 times 15) In the following code, which lines will be repeated 4 times? a) Lines 3 and 4 b) Lines 3-5 c) Lines 3-6 d) Lines 2-5 16) Why do certain words change color in Python? a) To show it is the wrong code b) To create hyperlinks in the code c) To tell Python to skip these words when the code is running d) To show that they are key words in Python 17) What does the setposition() command do? a) It moves Tracy and changes her direction b) It turns her direction and moves her to the upper left corner of the grid c) It moves Tracy to a specific (x,y) coordinate d) It stops Tracy from moving anywhere 18) If you want Tracy to execute her command immediately, which speed value would you use? a) 0 b) 1 c) 5 d) 10 19) How far would you have to move to draw each circle in the following image with 20 pixel radii? a) 20 pixels b) 10 pixels c) 60 pixels d) 40 pixels 20) Why are comments used in coding? a) To simplify code when it goes over 50 lines b) To aid in human understanding of the code c) To separate one command from the next d) To transfer the code for the computer to understand 21) What symbol is used at the beginning of an in-line or one line comment? a) # b) ! c) || d) "" 22) What symbol is used at the beginning of a multi-line comment? a) # b) ! c) """ d) /* 23) Which of the following names follows all the rules for naming a function or variable? a) my_function b) 4_circles c) make_square d) Draw a Circle 24) If I wanted a function to draw 2 circles, what would be the best name? a) two_circles b) 2_ Circles c) Draw_2_circles d) draw_Shapes_2 25) If you want 3 circles next to each other, how far would you move before drawing the next circle? a) 40 pixels b) 100 pixels c) The radius of the circle d) The diameter of the circle 26) What command do you use to make a turtle draw a regular polygon? a) draw_polygon() b) polygon() c) make_polygon() d) fill_polygon() 27) What command do you use to make a turtle draw a circle in Codehs? a) draw_circle() b) circle() c) make_circle() d) fill_circle() 28) What keyword do you use to define a function? a) def b) function c) define d) fn 29) What command do you use to make a turtle change its color in Codehs? a) change_color() b) set_color() c) color() d) fill_color() 30) Python is a computer programming language often used to build websites and software, automate tasks, and conduct data analysis. a) True b) False

Python Quiz Lessons 2.1-2.7

Edetabel

Visuaalne stiil

Valikud

Vaheta malli

Kas taastada automaatselt salvestatud ?