Python Programming Exam Review Questions With Correct Answers
forward(distance) - Answer moves turtle forward distance in current direction backward(distance) - Answer moves turtle backward in current direction circle(radius) - Answer moves the turtle in a circle. Within the parentheses, you write the radius of the circle. penUp, penDown - Answer controls whether or not Tracy is leaving a trail. What are the dimensions of Tracy's world? - Answer 400 pixel tall x 400 pixels wide left(angle), right(angle) - Answer turns Tracy either left or right the inputted degrees For loops - Answer used to repeat commands a certain number of times. What is the code for a for loop? - Answer for i in range(times to repeat): Indented commands here setposition(x,y) - Answer moves Tracy to the designated coordinate. speed(number 0-10) - Answer Sets how quickly Tracy will move through the code. speed(1)=Slowest speed(5)=Medium speed(10)=Fastest speed(0)=Immediate # comment here """ comment here '''' - Answer In-line comment Multi-line comment What is the code for defining? How do you call it? - Answer def function_name_here(): indented code here function_name() color("color name") - Answer Changes Tracy's trail color. pensize(#) - Answer Changes Tracy's trail thickness. begin_fill() - Answer Starts filling in drawn shapes. end_fill() - Answer Stops filling in drawn shapes. circle(radius, extent, steps) - Answer Can control the radius, degrees, and number of points of a circle. Top Down Design - Answer a problem solving approach (also known as stepwise design) in which you break down a system to gain insight into the sub-systems that make it up. variable_name = value - Answer Assigns a variable ex. color = input("Enter a color: ") for i in range(starting_num, ending_num, increase_by): - Answer alters the value of i by including a starting value, ending value, and a value to increase by on each iteration
Escuela, estudio y materia
- Institución
- Python Programming
- Grado
- Python Programming
Información del documento
- Subido en
- 7 de febrero de 2024
- Número de páginas
- 9
- Escrito en
- 2023/2024
- Tipo
- Examen
- Contiene
- Preguntas y respuestas
Temas
-
python programming stuvia
-
python programming exam review questions with corr
-
forwarddistance moves turtle forward distance in
-
backwarddistance moves turtle backward in curren