What is wrong with this for loop?
for i in range = 5;
move()
A. The for loop uses a semicolon(;) instead of colon(:)
B. It should say range(5) instead of range = 5
Adv CS I_Python_Intro to Programming
Quiz
•
Computers
•
12th Grade
•
Medium
Simone CTA]
Used 1+ times
FREE Resource
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is wrong with this for loop?
for i in range = 5;
move()
A. The for loop uses a semicolon(;) instead of colon(:)
B. It should say range(5) instead of range = 5
A
B
A and B
The for loop is correct
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the proper format for a single line comment in Karel?
// This is a comment
# This is a comment
/* This is a comment
This is a comment
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the mystery function do?
def mystery():
while no_balls_present():
move()
Karel moves until it puts down a ball
Karel moves once if there is no ball present
Karel moves until it is on a ball
Karel checks if there is no ball on the current spot and then moves once
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is not a valid condition to go in an if statement for Karel?
balls_present()
front_is_clear()
left_is_blocked()
turn_left()
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What condition should be used in this while loop to get Karel to pick up all the tennis balls on the current location?
while ________ :
take_ball()
take_ball()
front_is_clear()
balls_present()
no_balls_present()
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can we teach Karel new commands?
For loop
While loop
The main function
Define a new function
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Super Karel starts at Street 1, Avenue 1, facing East in a 5x5 world. What will happen after this code runs?
move()
move()
turn_right()
move()
Karel ends on street 1, avenue 3
Karel ends on street 2, avenue 3
This code won’t run because of a syntax error
Karel will crash into a wall
8.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What makes the following command an invalid Karel command?
It should end in semicolon
It should start with a capital T
This command is correct
The L should be a lower l
10 questions
CLASS 9 AI - VIVA 2024-25
Quiz
•
9th Grade - University
10 questions
Year 9 Programming Constructs
Quiz
•
1st - 12th Grade
10 questions
SC025: Control Structures Lecture Quiz
Quiz
•
12th Grade
10 questions
CodeHS 2.11 If Statements
Quiz
•
9th - 12th Grade
10 questions
Adv CS- Javascript- Programming with Karel
Quiz
•
12th Grade
6 questions
Coding Karel 1
Quiz
•
KG - University
13 questions
Understanding Loops and Control Structures
Quiz
•
12th Grade
12 questions
Computer Science
Quiz
•
3rd - 12th Grade
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
20 questions
Taxes
Quiz
•
9th - 12th Grade
17 questions
Parts of Speech
Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression
Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing
Quiz
•
9th - 12th Grade
10 questions
Identifying equations
Quiz
•
KG - University