FREE Online Courses: Click, Learn, Succeed, Start Now!
Python is one of the Programming languages that is widely used by developers. There are many reasons for its popularity among the programmers and the companies, which include, user-friendly nature, multiple modules, and libraries, versatility, etc. In the quiz on Python, you will be able to revise a wide range of basic topics including loops, conditionals, etc.
0 of 30 Questions completed
Questions:
Information
You have already completed the quiz before. Hence you can not start it again.
You must sign in or sign up to start the quiz.
You must first complete the following:
Quiz complete. Results are being recorded.
0 of 30 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0 )
Earned Point(s): 0 of 0 , (0 )
0 Essay(s) Pending (Possible Point(s): 0 )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Current
Review / Skip
Answered
Correct
Incorrect
Question 1 of 30
Which of the following is true about Python?
Question 2 of 30
Which of the following is not true about identifiers in Python?
Question 3 of 30
Difference between list and tuples in Python?
Question 4 of 30
Which of the following is not a data type in Python?
Question 5 of 30
Which of the following has a higher precedence?
Question 6 of 30
Which of the following is not a namespace in Python?
Question 7 of 30
Which of the following methods is used to jumble the elements of a list randomly?
Question 8 of 30
Which of the following is not loop controls in Python? Which of the following is not loop controls in Python?
Question 9 of 30
Which of the following cannot be used to implement a switch in Python?
Question 10 of 30
Which of the following is not a data structure that is derived from dictionaries?
Question 11 of 30
Find the output of the below code.
Question 12 of 30
Which of the following gives an error?
Question 13 of 30
What is the output of the below code?
string = “\t\t\t\n\n\nPythonGeeks\n\n\n\t\t\t”
string.strip()
Question 14 of 30
Find the output of the below code.
seq1=(1,2,3,4,5,6,7,8,9,10)
seq1[-1::-2]
Question 15 of 30
What is the output of the following code?
Question 16 of 30
Which of the following gives an error for the dictionary below?
dict1={1:’one’,2:’two’,3:’three’,4:’four’}
Question 17 of 30
What is the output of the below code?
Question 18 of 30
Which of the following is the correct way to use filter function?
Question 19 of 30
Find the output of the code.
def func(a):
print(a**2)
fund(4)
Question 20 of 30
Which of the following gives an error?
Question 21 of 30
Find the output of the below code?
“,”.join([’12’,’34’,’56’])
Question 22 of 30
What is the output of the below code?
var=3
def func1():
var=4
def func2():
global var
var=10
func2()
print(var)
func1()
Question 23 of 30
Find the output of the below code.
Question 24 of 30
Which of the following is the correct way to print the following statement
“His name is abc and he loves Python”
If name =’abc’ and lang=’Python’?
Question 25 of 30
What is the output of the below code?
seq=[‘a’,’b’,’f’,’i’]
seq.extend([1,2])
seq
['a', 'b', 'f', 'i', [1, 2]]
['a', 'b', 'f', 'i', 1, 2]
SyntaxError
AttributeError
Question 26 of 30
Find the output of the below code.
seq1={1,2,3,2,4}
seq2={3,9,0}
seq1.update(seq2)
len(seq1)
Question 27 of 30
What is the output of the below code?
from collections import defaultdict
dDic=defaultdict(lambda:0)
dDic[1]=3
dDic[4]=5
dDic[2]
Question 28 of 30
Which of the following give the output as 12345?
Question 29 of 30
Find the output of the below code?
a=6
if(a>=6):
print(a-1,end=’ ‘)
elif (a<=6):
print(a,end=”)
Question 30 of 30
What is the output of the below code?
a=5
while(a>0):
if(a/2==1):
break;
print(a,end=”)
a=a-2
else: print(‘end’)
Summary
Hope you enjoyed taking the above Python quiz. Learning and practicing make you perfect. Hope to see you at another quiz. Happy coding!