Font size
WorksheetsBasics of Python Programming Unit-1
Total questions: 20
Worksheet time: 12mins
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 mentioned
What will be the value of the following Python expression?
4 + 3 % 5
7
2
4
1
Which of the following is used to define a block of code in Python language?
Indentation
Key
Brackets
All of the mentioned
Expand IDLE
(a)
What is the order of precedence in python?
Exponential, Parentheses, Multiplication, Division, Addition, Subtraction
Exponential, Parentheses, Division, Multiplication, Addition, Subtraction
Parentheses, Exponential, Multiplication, Division, Subtraction, Addition
Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
What is the output of the following piece of code when executed in Python shell?
>>> a=("Check")*3
>>> a
(‘Check’,’Check’,’Check’)
* Operator not valid for tuples
(‘CheckCheckCheck’)
Syntax error
Which are arithmetic operators?
+
-
>
<
Examples of String Literals
"ABC1273"
nfjdlsj@@$
12638
'7e920938'
Which of the following is true for variable names in Python?
underscore and ampersand are the only two special characters allowed
unlimited length
all private members must have leading and trailing underscores
none of the mentioned
What will be the output of the following Python statement?
>>>"a"+"bc"
bc
abc
a
bca
Which one of the following is not a keyword in Python language?
pass
eval
assert
nonlocal
What are the two main types of functions in Python?
System function
Custom function
Built-in function & User defined function
User function
Which of the following is an invalid statement?
abc = 1,000,000
a b c = 1000 2000 3000
a,b,c = 1000, 2000, 3000
a_b_c = 1,000,000
what is the output of
int('32')
32
'32'
int
str
What is the output of the following code?
p, q, r = 10, 20 ,30
print(p, q, r)
10 20
10 20 30
Error: invalid syntax
x = 36 / 4 (3 + 2) 4 + 2
print(x)
182.0
37
117
The Program executed with errors
What is the output of the following code?
var= 'James' * 2 * 3
print(var)
JamesJamesJamesJamesJamesJames
JamesJamesJamesJamesJames
james
Error: invalid syntax
What is the output of the following code?
var1 = 1
var2 = 2
var3 = "3"
print(var1 + var2 + var3)
6
33
123
Error. Mixing operators between numbers and strings are not supported
Which operator has higher precedence in the following list
% (Modulus)
& (BitWise AND)
** (Exponent)
> (Comparison)
