Python MCQ (Mulitple Choice Questions and Answers)
-
Who developed Python Programming Language?
Wick van Rossum
Rasmus Lerdorf
Guido van Rossum
Niene Stom
-
Which type of Programming does Python support?
object-oriented programming
structured programming
functional programming
all of the above
-
Which of the following is the correct extension of the Python file?
.python
.pl
.py
.p
-
All keywords in Python are in
Capitalized
Lower Case
Upper Case
None of the above
-
Which keyword is used for function in Python language?
function
def
fun
define
-
Which type of Programming does Python support?
object-oriented programming
structured programming
functional programming
all of the above
-
Is Python case sensitive when dealing with identifiers?
No
Yes
-
Which of the following is used to define a block of code in Python language?
Indentation
Key
Brackets
All of the above
-
Which of the following character is used to give single-line comments in Python?
//
#
!
/*
-
Which of the following functions is a built-in function in python?
factorial()
print()
seed()
sqrt()
-
Which of the following would NOT work as a variable name?
a
len
length
x
-
In which year was the Python language first released?
1995
1972
1981
1991
-
Which one of the following is not a python's predefined data type?
List
Dictionary
Tuple
Class
-
Which of the following has more precedence?
+
()
/
-
-
What arithmetic operators cannot be used with strings in Python?
*
-
+
All of the above
-
In which language is Python written?
Java
PHP
C
All of the above
-
How to convert the lowercase letters in the string to uppercase in Python?
uppercase()
toUpper()
capitalize()
upper()
-
How to convert the uppercase letters in the string to lowercase in Python??
lowercase()
capilaize()
lower()
toLower()
-
Which of the following statements is used to create an empty set in Python?
( )
[ ]
{ }
set()
-
What are the two main types of functions in Python?
System function
Custom function
User function
Built-in function & User defined function
-
Which of the following data types is not supported in python ?
String
Slice
Numbers
List
-
Do we need to compile a program before execution in Python?
No
Yes
-
Are nested if-else are allowed in Python?
Yes
No
-
What is the maximum possible length of an identifier in python?
18
41
62
79
-
In Python, a variable must be declared before it is assigned a value?
True
False
-
How can we create an empty list in python?
list=()
list.null
list=[]
null.list
-
What is type casting in python?
Declaration of data type
Destroy data type
Change data type property
None of the above
-
In python programming, pass is a null statement.
True
False
-
In order to store values in terms of key and value we use that core data type in python?
List
Class
Dictionary
Tupple
-
Operators with the same precedence are evaluated in which manner?
Left to Right
Right to Left
Can’t say
None of the above