Week 1 : Assignment 1
Due date: 2025-02-05, 23:59 IST.Assignment not submitted
1 point
Which of the following variable names are INVALID in Python?
1_variable
variable_1
variable1
variable#
1 point
Which of the following operators have lower precedence than “not” in Python?
+
and
==
|
1 point
What will be the output of the following code?
a = 10
b = 5
print(a ** b % 3)
- 0
- 100
- 1
- 2
1 point
What will be the output of the following code snippet?
greetings = "Namaste"
greetings_1 = float(greetings)
print(type(greetings_1))
int
float
str
- Code will throw an error.
1 point
Given two variables, j = 6
and g = 3.3
. If both normal division and floor division operators were used to divide j
by g
, what would be the data type of the value obtained from the operations?
int, int
float, int
float, float
int, float
1 point
What will be the output of the following code snippet?
a = "10"
b = float(a) + 5
result = str(b) + "123"
print(type(result))
<class 'float'>
<class 'str'>
<class 'int'>
- The code will give an error.
1 point
What will be the output of the following code snippet?
a = 15
b = 3
c = 4
result = a + b * c // (c % b) - 5
print(result)
- 20
- 1
- 22
- 0
1 point
What is the output of the following code snippet?
a = 4
b = 5
a *= b * 2
print(a)
- 10
- 20
- 25
- 40
1 point
What is the output of the following code snippet?
a = 3
b = 5
c = (a == 3) and (b == 5) or (a != 3)
print(c)
- True
- False
- Error
1 point
Let a = 5
(101 in binary) and b = 3
(011 in binary). What is the result of the following operation?
a = 5
b = 3
print(a & b)
- 3
- 7
- 5
- 1