CORRECT DETAILED ANSWERS WITH RATIONALES
RAT 2 - correct answer-
What is the output of the following program?
length_x = 3.2
length_y = 2
area_rect = length_x*length_y
print(area_rect) - correct answer-6.4
What is the output of the following code?
num_x = 3
num_y = 2
val_num = num_x//num_y
print(val_num) - correct answer-1
What is the output of the following program?
num_x = 6
num_y = 2
val_num = num_x + num_y
print('val_num') - correct answer-val_num
What is the output of the following program?
num1 = 33
num2 = 55
,num3 = float(num1)
print(num3) - correct answer-33.0
What is the output of the following program?
a = 10
b = 2**4
b -= a
c = b//2
print(c) - correct answer-3
RAT 3 - correct answer-
What is the value stored in variable X after all the following python statements are executed?
X=2
Y=5
Z = X*Y
X = X*Z - X - correct answer-18
Pick the python statement to assign yourCage (an integer value 19) to the variable "my_age"? -
correct answer-my_age = 19
Consider the following piece of code:
x = multiplication
typedInput = input('Enter any number: ')
print(typedInput x 2 + str(float(typedInput) x 5))
When executed, the user entered the integer 2 as shown below.
Enter any number: 2
, What will be printed to the console? - correct answer-2210.0
What is the output printed when the following lines of code are executed? Note that the answer is case
sensitive
x = str(bool(0))
print(x*2) - correct answer-FalseFalse
What will be the output of the following Python code?
print((2 x 5 + (10 // 5) / 10) x 10.0) - correct answer-102.0
RAT 4 - correct answer-
What is the output for the following program? [Quotes indicate String Data Type]
a = "1"
b = "32"print(a+b) - correct answer-"132"
What is the output of the following program?
a = 23
b = 43
a *= 12
b += 13*a
c = a+b
c -= c+5
print(c) - correct answer--5
The output of the following line of code: int('3.5') WILL produce the value 3.