Code HS 2 Questions and Answers with Certified Solutions
Code HS 2 Questions and Answers with Certified Solutions Why are parameters useful? They allow us to tailor functions to be used in multiple situations How many parameters can we use in each function? As many as we need What is the default starting value of i in a for loop? 0 What will the values of i be at each iteration of the loop below? For i in range(3): 0, 1, 2 What will happen when the value of i reaches 5 in the loop below? for i in range(5): left(i) right(90) Tracy will turn 90 degrees to the right Why do we use if statements? To have Tracy make decisions based on conditional statements If we write an if statement and the condition is false, what does Tracy do? Tracy skips the commands under the if statement How would we write an if statement where Tracy will put the pen down if a variable called count was positive? if count 0: pendown() Which comparison operator means 'is not equal to'? != If the following code was run, how far would Tracy move? 100 pixels
Written for
- Institution
- Code HS
- Course
- Code HS
Document information
- Uploaded on
- March 10, 2023
- Number of pages
- 2
- Written in
- 2022/2023
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
code hs 2 questions and answers with certified solutions
Also available in package deal