NEW
Font size
WorksheetsPython Basics
Total questions: 15
Worksheet time: 8mins
What will be the datatype of the var in the below code snippet?
float and str
number and str
int and str
number and char
How is a code block indicated in Python?
Bracket
Indentation
Key
None of the above
What will be the output of the following code snippet?
[2,2,3]
(2,2,3)
(1,2,3)
Error
What will be the output of the following code snippet?
int and float
float and int
float and float
int and int
What will be the output of the following code snippet?
15
0
20
None of these
Which of the following concepts is not a part of Python?
Pointers
Loops
Dynamic typing
All of the above
What will be the output of the following code snippet?
['Sunday','Monday','Tuesday','Wednesday']
['Monday','Tuesday','Wednesday']
['Sunday','Monday','Wednesday']
None of these
Which of the following are valid string manipulation functions in Python?
count()
upper()
strip()
All of the above
Which of the following modules need to be imported to handle date time computations in Python?
datetime
date
time
timedate
In which language is Python written?
C++
Python
C
None of these
Which type of Programming does Python support?
object oriented programming
structured programming
functional programming
All of the above
Which of the following character is used to give single-line comments in Python?
//
#
<!-- -->
$
Which one of the following is not a keyword in Python language?
pass
eval
assert
nonlocal
Which of the following is a feature of Python DocString?
In Python all functions should have a docstring
It provides a convenient way of associating documentation with Python modules, functions, classes, and methods
Docstrings can be accessed by the __doc__ attribute on objects
All of the mentioned
a = True
b = False
c = False
if a or b and c:
print ("GEEKSFORGEEKS")
else:
print ("geeksforgeeks")
What will be the output?
GEEKSFORGEEKS
geeksforgeeks
GEEKSFORGEEKS
geeksforgeeks
Run time error (Multiple operators in a single if statement)
