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
To check all the characters in a string are letters or not, we use ... method.
A
isidentifier()
B
isupper()
C
isdecimal()
D
islower()
E
isalpha()
Question 2
What is the output of this python code?
a = [1,2,3,4,5]
print(list(map(lambda x:x*10-1, a)))
A
[10, 20, 30, 40, 50]
B
[100, 200, 300, 400, 500]
C
[9, 19, 29, 39, 49]
D
[19, 119, 129, 139, 149]
E
[1, 2, 3, 4, 5]
Question 3
How to create [1, 2, 'b', 'c', 'e', 'f', 'd'] with [1, 2, "b", "c","d"]? (list a)
A
a[3:] = ["e","f"]
B
a[2:2] = ["e","f"]
C
a[3:2] = ["e","f"]
D
a[4:] = ["e","f"]
E
a[4:2] = ["e","f"]
Question 4
What is the output of this python code?
x = min(3, 7, 15)
y = max(2, 5, 12)
print(x*y)
A
120
B
24
C
12
D
36
E
144
Question 5
How to access to the last character in the below string?
A
"Hello"[-2]
B
"Hello"[%]
C
"Hello"[-1]
D
"Hello"[&]
E
"Hello"[1]
Question 6
What is the result of the below python code?
list = [4,6,7,2,8]
list.reverse()
print(list)
A
[2, 4, 6, 7, 8]
B
[8, 6, 4, 2, 7]
C
[8, 2, 7, 6, 4]
D
[4,6,7,2,8]
E
[8, 7, 6, 4, 2]
Question 7
What is the output of this python code?
abc = {1,2,3,4,5}
print(type(abc))
A
class set
B
C
set
D
{1,2,3,4,5}
E
abc
Question 8
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
{2, 3}
B
{1,2, 3}
C
none of them
D
{1,2,3,7,10,15}
E
{2,3,7,10,15}
Question 9
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
7
C
6
D
4
E
3
Question 10
How to access "bear" and "wolf" items in list x? 
x= ["eagle","bear","wolf", "lion", "tiger"]
A
x[:2]
B
x[-4:-2]
C
x[1:2]
D
x[1:-2]
E
x[4:2]
Question 11
What is the output of this python code?
list = [10, ["aa", "bb", 11, ["x", "y", "z"], "cc"], 33]
print(list[1][3][2])
A
y
B
z
C
x
D
33
E
cc
Question 12
With which python code can we count "10" item in list x?
A
x.sort(10)
B
x.cal(10)
C
x.count(10)
D
x.find(10)
E
x.upper(10)
Question 13
How to access "Zidane" and "Robben" items in tuple y?
y= ("Ronaldo","Messi","Hagi","Zidane","Robben")
A
x[1:3]
B
x[3:]
C
x[2:]
D
x[:2]
E
x[:3]
Question 14
What is the output of this python code?
a=5
print("a+1")
A
a
B
5
C
a+1
D
6
E
none of them
Question 15
To check if all the characters in the text are in upper case, we use ... method.
A
isnumeric()
B
isupper()
C
islower()
D
isdigit()
E
istitle()
Question 16
What is the Output Of This Python Math Code?
import math
print(math.sqrt((pow(5,2)-15)*10))
A
25.0
B
15.0
C
10.0
D
5.0
E
20.0
Question 17
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
0, 12, 2
B
5, 15, 3
C
0, 15, 3
D
2, 12, 3
E
2, 18, 2
Question 18
Which python method removes the last item in a list?
A
remove()
B
pop()
C
insert()
D
extend()
E
del()
Question 19
Which symbol can be used instead of python set union method?
A
&
B
*
C
|
D
^
E
%
Question 20
With which python method, can we add a new list item between other list items? 
A
append()
B
insert()
C
index()
D
copy()
E
extend()
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