8/IG/Comp.Sci/Asg-4/Quiz
Quiz by Shalini K
Feel free to use or edit a copy
includes Teacher and Student dashboards
Measure skillsfrom any curriculum
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
- edit the questions
- save a copy for later
- start a class game
- automatically assign follow-up activities based on students’ scores
- assign as homework
- share a link with colleagues
- print as a bubble sheet
- Q1
What does the 'len()' function do in Python?
It generates a sequence of numbers.
It sorts a list in descending order.
It returns the length of a string data.
It converts a string to lowercase.
30s - Q2
What is the difference between '==' and '=' in Python?
'==' is used for string comparison, while '=' is used for character comparison.
Both '==' and '=' assign values.
The '==' operator compares the values of two objects, while '=' assigns right hand side value to the lefthand side variable.
Both '==' and '=' check if two objects are the same object.
30s - Q3
What is the purpose of the 'if' statement in Python?
To define a function in Python.
To execute a block of code if a certain condition is true.
To catch and handle exceptions in Python.
To repeat a block of code until a condition is true.
30s - Q4
What is the output of the following code?
x = 5
print(x > 3 and x < 10)
None
False
Error
True
30s - Q5
How do you comment a single line of code in Python?
Using the /* */ symbols
Using the // symbol
Using the # symbol
Using the < > symbols
30s - Q6
x= "Hello World"
print(x[1])
What is the output of this code snippet?
E
Hello
e
H
30s - Q7
Which operator is used for exponentiation in Python?
++
%
**
^
30s - Q8
What is the output of this code snippet?
print(5+4*9/3)
17.0
13.6666666
27.0
50/3
30s - Q9
Which of the following is NOT a Python logical opeartor?
or
not
if
and
30s - Q10
Which statement lets you skip an iteration in a loop?
you can't skip an iteration in a loop
continue
pass
break
30s