Python while loops

Quiz
•
Computers
•
12th Grade
•
Hard
Sean Rattigan
Used 245+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
For the code shown, what will happen?
It will print all the numbers from 0 to 11
It will print all the numbers from 0 to 11 in increments of 3
Infinite loop
It will not run (Syntax error)
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A while loop is used when
You know how many times you are going to loop
You want to loop for an unknown number of times, and possibly forever
You only want to run the code in the loop once
You see the word while in the problem description
3.
FILL IN THE BLANK QUESTION
1 min • 1 pt
What is the final value of n?
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Why is iteration important?
It determines the order in which instructions are carried out
It allows code to be simplified by removing duplicated steps into a block that can be executed many times
It allows multiple paths through a program
It ensures the code works correctly
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of this code?
It would print 'So good to see you' infinite number of times
There would be no output
It would print an error message.
It would print 'Enter correct code'.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The condition for a while loop to continue could include which of the following?
While something equals something
While something is True
While something is greater than something
All of these
7.
FILL IN THE BLANK QUESTION
1 min • 1 pt
What is the final value of the variable 'number'?
Create a free account and access millions of resources
Similar Resources on Wayground
16 questions
C-Programming Basics

Quiz
•
12th Grade
20 questions
quiz dasar python

Quiz
•
1st Grade - University
25 questions
HTML, CSS & JS

Quiz
•
11th - 12th Grade
20 questions
Code.org CSD Unit 3 Lessons 1-12

Quiz
•
3rd - 12th Grade
20 questions
iGCSE Computer Science: Problem Solving

Quiz
•
9th - 12th Grade
19 questions
Python Print Function Quiz

Quiz
•
12th Grade
15 questions
Java Level 1 - A

Quiz
•
12th Grade
20 questions
Python -Iteration (loops)

Quiz
•
7th - 12th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Appointment Passes Review

Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
Grammar Review

Quiz
•
6th - 9th Grade