
Python Quiz
Authored by Sarika Kaushal
Computers
12th Grade
Used 32+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
15 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
How to create a single element tuple
(1,)
(1)
{1}
[1]
tuple([1])
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Result of the program above is
('1', '2', '3', '4', '5')
(1, 2, 3, 4, 5)
12345
"12345"
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the “hello” +1+2+3?
hello123
hello
hello6
Error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Python code?
print("xyyzxyzxzxyy".count('yy'))
2
0
5
Error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Suppose t = (1, 2, 4, 3), which of the following is incorrect?
print(t[3])
t[3] = 45
print(max(t))
print(len(t))
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Python code?
>>>t=(1,2,4,3)
>>>t[1:-1]
(1, 2)
(1, 2, 4)
(2, 4)
(2, 4, 3)
7.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Assume the following list definition:
>>> a = ['foo', 'bar', 'baz', 'qux', 'quux', 'corge']
Several short REPL sessions are shown below. Which display correct output?
>>> print(a[-6])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IndexError: list index out of range
>>> a[:] is a
True
>>> print(a[4::-2])
['quux', 'baz', 'foo']
>>> print(a[-5:-3])
['bar', 'baz']
>>> max(a[2:4] + ['grault'])
'qux'
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
10 questions
AIJ Test 1 Firewall Jaringan
Quiz
•
9th - 12th Grade
10 questions
Excel
Quiz
•
11th - 12th Grade
15 questions
Vocabulary of Computer
Quiz
•
12th Grade
10 questions
Bài 25 tin 10
Quiz
•
9th Grade - University
20 questions
Teknik Pengolahan Audio dan Video
Quiz
•
12th Grade
10 questions
Intro to Windows Server 2012
Quiz
•
12th Grade
10 questions
Arduino
Quiz
•
7th - 12th Grade
10 questions
Sistema Operativo
Quiz
•
1st - 12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade