Python Programming Exam Review With 100% Correct And Verified Answers
Python Programming Exam Review With 100% Correct And Verified Answers forward(distance) - Correct Answer-moves turtle forward distance in current direction backward(distance) - Correct Answer-moves turtle backward in current direction circle(radius) - Correct Answer-moves the turtle in a circle. Within the parentheses, you write the radius of the circle. penUp, penDown - Correct Answer-controls whether or not Tracy is leaving a trail. What are the dimensions of Tracy's world? - Correct Answer-400 pixel tall x 400 pixels wide left(angle), right(angle) - Correct Answer-turns Tracy either left or right the inputted degrees For loops - Correct Answer-used to repeat commands a certain number of times. What is the code for a for loop? - Correct Answer-for i in range(times to repeat): Indented commands here setposition(x,y) - Correct Answer-moves Tracy to the designated coordinate. speed(number 0-10) - Correct 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 '''' - Correct Answer-In-line comment Multi-line comment What is the code for defining? How do you call it? - Correct Answer-def function_name_here(): indented code here function_name() color("color name") - Correct Answer-Changes Tracy's trail color. pensize(#) - Correct Answer-Changes Tracy's trail thickness. begin_fill() - Correct Answer-Starts filling in drawn shapes. end_fill() - Correct Answer-Stops filling in drawn shapes. circle(radius, extent, steps) - Correct Answer-Can control the radius, degrees, and number of points of a circle. Top Down Design - Correct 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 - Correct Answer-Assigns a variable ex. color = input("Enter a color: ") for i in range(starting_num, ending_num, increase_by): - Correct Answer-alters the value of i by including a starting value, ending value, and a value to increase by on each iteration if statement - Correct Answer-The common programming structure that implements "conditional statements". Ex. if condition: If true, run the commands here(indented) elif condition: If first condition is false, if true, run the commands here else: If no other conditions are true, if true, run the commands here while loop - Correct Answer-a programming construct used to repeat a set of commands (loop) as long as (while) a boolean condition is true ex. while condition: Run commands here (indented)
Documentinformatie
- Geüpload op
- 29 maart 2024
- Aantal pagina's
- 6
- Geschreven in
- 2023/2024
- Type
- Tentamen (uitwerkingen)
- Bevat
- Vragen en antwoorden