Python Quiz 5

PYTHON QUIZ 5

CONGRATULATIONS! YOU HAVE COMPLETED PYTHON QUIZ 5. YOU HAVE %%SCORE%% TRUE ANSWERS OUT OF %%TOTAL%% QUESTIONS. YOUR SCORE IS %%PERCENTAGE%%. %%RATING%%
Your answers are highlighted below.
Question 1
With which python method, can we add a new list item between other list items? 
A
append()
B
extend()
C
copy()
D
insert()
E
index()
Question 2
What is the output of this python code?
abc = {1,2,3,4,5}
print(type(abc))
A
abc
B
class set
C
D
{1,2,3,4,5}
E
set
Question 3
What is the output of the below python code?
numbers = [2,5,6,2,7,6,2]
x = numbers.index(7)
y = numbers.count(2)
print(x+y)
A
8
B
4
C
6
D
3
E
7
Question 4
With which python code can we count "10" item in list x?
A
x.find(10)
B
x.sort(10)
C
x.count(10)
D
x.cal(10)
E
x.upper(10)
Question 5
Which python method removes the last item in a list?
A
extend()
B
insert()
C
del()
D
remove()
E
pop()
Question 6
What is the Output Of This Python Math Code?
import math
print(math.sqrt((pow(5,2)-15)*10))
A
20.0
B
25.0
C
5.0
D
15.0
E
10.0
Question 7
How to access "bear" and "wolf" items in list x? 
x= ["eagle","bear","wolf", "lion", "tiger"]
A
x[1:2]
B
x[:2]
C
x[4:2]
D
x[-4:-2]
E
x[1:-2]
Question 8
What is the output of this python code?
x = min(3, 7, 15)
y = max(2, 5, 12)
print(x*y)
A
12
B
24
C
36
D
120
E
144
Question 9
To check if all the characters in the text are in upper case, we use ... method.
A
istitle()
B
isnumeric()
C
isupper()
D
isdigit()
E
islower()
Question 10
What is the result of the below python code?
list = [4,6,7,2,8]
list.reverse()
print(list)
A
[8, 7, 6, 4, 2]
B
[2, 4, 6, 7, 8]
C
[4,6,7,2,8]
D
[8, 6, 4, 2, 7]
E
[8, 2, 7, 6, 4]
Question 11
How to access to the last character in the below string?
A
"Hello"[%]
B
"Hello"[1]
C
"Hello"[-2]
D
"Hello"[-1]
E
"Hello"[&]
Question 12
Which symbol can be used instead of python set union method?
A
&
B
^
C
|
D
%
E
*
Question 13
What is the output of this python code?
a = [1,2,3,4,5]
print(list(map(lambda x:x*10-1, a)))
A
[1, 2, 3, 4, 5]
B
[9, 19, 29, 39, 49]
C
[19, 119, 129, 139, 149]
D
[10, 20, 30, 40, 50]
E
[100, 200, 300, 400, 500]
Question 14
How to access "Zidane" and "Robben" items in tuple y?
y= ("Ronaldo","Messi","Hagi","Zidane","Robben")
A
x[2:]
B
x[:3]
C
x[1:3]
D
x[:2]
E
x[3:]
Question 15
If the output of the below python code is [0, 3, 6, 9, 12], what is the missing part? (--?--) 
list=[]
for x in range(--?--):
list.append(x)
print(list)
A
5, 15, 3
B
0, 15, 3
C
2, 18, 2
D
0, 12, 2
E
2, 12, 3
Question 16
What is the output of this python code?
numbers1 = {1,2,3}
numbers2 = {2,3,7,10,15}
numbers3 = numbers1.intersection(numbers2)
print(numbers3)
A
{1,2, 3}
B
none of them
C
{2,3,7,10,15}
D
{1,2,3,7,10,15}
E
{2, 3}
Question 17
How to create [1, 2, 'b', 'c', 'e', 'f', 'd'] with [1, 2, "b", "c","d"]? (list a)
A
a[4:2] = ["e","f"]
B
a[3:] = ["e","f"]
C
a[4:] = ["e","f"]
D
a[3:2] = ["e","f"]
E
a[2:2] = ["e","f"]
Question 18
What is the output of this python code?
a=5
print("a+1")
A
a+1
B
5
C
6
D
none of them
E
a
Question 19
What is the output of this python code?
list = [10, ["aa", "bb", 11, ["x", "y", "z"], "cc"], 33]
print(list[1][3][2])
A
cc
B
33
C
x
D
z
E
y
Question 20
To check all the characters in a string are letters or not, we use ... method.
A
isidentifier()
B
isdecimal()
C
isupper()
D
isalpha()
E
islower()
Once you are finished, click the button below. Any items you have not completed will be marked incorrect. Get Results
There are 20 questions to complete.
gokhan-kosem-instructor-ipcisco

Gokhan Kosem is a Network Engineer, Instructor and the Founder of IPCisco.com with 15+ years of experience in Cisco, Nokia, Huawei, Juniper, Linux, Service Provider Networks, Routing and Switching technologies.

He has worked on the backbone networks of major service providers and network vendors including Nortel, Alcatel-Lucent (Nokia) and has extensive hands-on experience with Cisco, Huawei, Juniper and Nokia networking technologies.

He has trained thousands of networking students worldwide through IPCisco.com, Udemy, books, labs, quizzes, and educational content across multiple social media platforms.

IPCisco.com | Best Route to Your Dreams