
Cyber Sleuth Tier 1

Quiz
•
Computers
•
University
•
Hard
Asymmetric Club
Used 7+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What will be the output of the following code?
[1, 2]
[2,3]
[3,4]
[3,4,5]
Answer explanation
The slicing a[2:4] returns elements from index 2 up to (but not including) index 4.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to open a file for reading in Python?
file = open('filename.txt', 'w')
file = open('filename.txt', 'r')
file = open('filename.txt', 'a')
file = open('filename.txt', 'x')
Answer explanation
The mode 'r' opens the file for reading.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given the dictionary
d = {'one': 1, 'two': 2, 'three': 3},
what is the result of d.get('four')?
None
KeyError
0
4
Answer explanation
The get() method returns None if the key is not found and no default value is provided.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
a: 1 b: 5 c: 10
a: 1 b: 2 c: 10
a: 1 b: 2 c: 5
a: 1 b: 5 c: 2
Answer explanation
The function call func(1, 2) assigns 1 to a and 2 to b, using the default value 10 for c.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet?
[1, 2, 3]
[1, 2, 3, 4]
[2]
None
Answer explanation
b is a reference to a, so changes to b affect a
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a mutable data type in Python?
int
str
tuple
list
Answer explanation
Lists are mutable, meaning their elements can be changed.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you create a set in Python?
s = {}
s = set([])
s = []
s = ()
Answer explanation
set([]) creates an empty set. {} creates an empty dictionary.
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Python Basics

Quiz
•
University
10 questions
Indexing and Slicing in Python

Quiz
•
4th Grade - University
10 questions
java script

Quiz
•
University
20 questions
[Python For All] Quiz 2 - Rewind.py

Quiz
•
University
10 questions
Lesson 3: Boolean Logic and Logic Gates

Quiz
•
University
17 questions
Python Loops

Quiz
•
University
20 questions
Big Data & Hadoop

Quiz
•
University
15 questions
Coding club Summit Online Quiz

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University