Python Quiz

Quiz
•
Computers
•
12th Grade
•
Medium
Sarika Kaushal
Used 29+ times
FREE Resource
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'
Create a free account and access millions of resources
Similar Resources on Wayground
13 questions
L3 U14 Python Basics 2

Quiz
•
11th - 12th Grade
20 questions
Python Quiz (part 1)

Quiz
•
9th - 12th Grade
10 questions
THỰC HÀNH SỐ 1

Quiz
•
12th Grade
19 questions
Computer Science Refreshment

Quiz
•
12th Grade
20 questions
Gateway Level 3 Python Quiz 2

Quiz
•
9th - 12th Grade
15 questions
python basics quiz

Quiz
•
9th - 12th Grade
16 questions
Python programming

Quiz
•
6th - 12th Grade
15 questions
Python Lists

Quiz
•
10th - 12th Grade
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
Discover more resources for Computers
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
62 questions
Spanish Speaking Countries, Capitals, and Locations

Quiz
•
9th - 12th Grade
20 questions
First Day of School

Quiz
•
6th - 12th Grade
6 questions
Maier - AMDM - Unit 1 - Quiz 1 - Estimation

Quiz
•
12th Grade
21 questions
Arithmetic Sequences

Quiz
•
9th - 12th Grade
21 questions
9th Grade English Diagnostic Quiz

Quiz
•
9th - 12th Grade
7 questions
Characteristics of Life

Interactive video
•
11th Grade - University