1045 week 4

Quiz
•
Fun, Computers
•
University
•
Medium
Ajay Kanagendran
Used 6+ times
FREE Resource
5 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When should we use a while loop instead of a for loop?
When the intervals or incremental values are known.
When the condition required to be satisfied to exit loop are not obvious or uniform
Depends on my mood
They are both the same
2.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
If we want to iterate through a list of strings and only print string that start with "A" or "I", whats the best way to do it?
For loop
While loop
It can't be done
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does range(99,1,-2) return?
Syntax error since there's no for loop
A list of all numbers between 99 inclusive and 1 inclusive ([99,98,97,....,2,1])
A list of every second number between 99 inclusive and 1 inclusive ([99,97,95,....,5,3,1])
A list of every second number between 99 inclusive and 1 exclusive ([99,97,95,....,5,3])
4.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
qTuple = (1,2,3)
qTuple[1] = 11
print(qTuple)
What does the code above
(11,2,3)
(1,2,3), since tuples are immutable
Error since tuples are immutable
5.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
dict = {
"apple": "an apple a day, keeps the doctor away",
"cloud": "every cloud has a silver lining",
"sun": "as bright as the sun"
}
print(dict["appl"])
What's the output of the code above?
an apple a day, keeps the doctor away
Key error since the key does not exist
Null since the key does not exist
Similar Resources on Wayground
10 questions
Python with DataScience

Quiz
•
7th Grade - University
10 questions
104-P-01: Delegates and lambdas

Quiz
•
University
10 questions
Python Programming Concepts Challenge

Quiz
•
10th Grade - University
10 questions
DBMS concepts (Easy)

Quiz
•
University
10 questions
Round 1

Quiz
•
University
10 questions
Kegiatan Belajar 6

Quiz
•
University
6 questions
Python Programming Quiz

Quiz
•
4th Grade - University
10 questions
Fundamentals of Python Programming

Quiz
•
University
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade