
Mastering Python Loops, Lists and Strings
Authored by Harmeet Kaur
Computers
11th Grade

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What is the syntax for a for loop in Python?
foreach variable in sequence:
for each variable in sequence:
for (variable; condition; increment)
for variable in sequence:
2.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
How do you create a while loop that runs until a variable reaches 10?
while (variable = 10) { variable++; }
while (variable < 10) { variable++; }
while (variable != 10) { variable++; }
while (variable > 10) { variable--; }
3.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What method would you use to convert a string to lowercase in Python?
lowercase()
convertToLower()
.lower()
.toLowerCase()
4.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
How can you create a list of squares of numbers from 1 to 10 using list comprehension?
[x^2 for x in range(1, 10)]
[x**2 for x in range(1, 11)]
[x*2 for x in range(1, 11)]
[x**3 for x in range(1, 11)]
5.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What is the output of the following code: for i in range(5): print(i)?
0 1 2 3 4
3.5
-1
5
6.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Explain how nested loops work with an example.
For example, in a 2D array, an outer loop can iterate through rows, while an inner loop iterates through columns: for (int i = 0; i < rows; i++) { for (int j = 0; j < columns; j++) { process(array[i][j]); } }
An outer loop cannot access the inner loop's variables.
Nested loops can only be used with single-dimensional arrays.
Nested loops are not efficient for processing data.
7.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What string method would you use to find the length of a string?
length()
count()
len()
size()
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
25 questions
Latihan Soal Pemrograman
Quiz
•
11th Grade
26 questions
Macromedia Flash
Quiz
•
8th Grade - Professio...
25 questions
Understanding Strings and Functions Quiz
Quiz
•
8th Grade - University
25 questions
Code.org Quiz1
Quiz
•
7th Grade - University
25 questions
TAD Quiz SAS
Quiz
•
11th Grade
25 questions
Robotics Mid-term Assessment Grade VII
Quiz
•
6th Grade - University
29 questions
Computer Parts
Quiz
•
9th - 12th Grade
25 questions
Python
Quiz
•
9th - 12th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Computers
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
15 questions
Christmas Song Emoji Pictionary
Quiz
•
7th - 12th Grade
20 questions
Christmas Movies
Quiz
•
1st - 12th Grade
20 questions
Christmas Movie Trivia
Quiz
•
9th - 12th Grade
29 questions
christmas facts
Lesson
•
5th - 12th Grade
20 questions
Christmas Trivia
Quiz
•
5th - 12th Grade
20 questions
Stages of Meiosis
Quiz
•
9th - 12th Grade
20 questions
christmas songs
Quiz
•
KG - University