You are on page 1of 4

Module 1 - Introduction to Python - Variables, expressions, and statements

Time:
20:38
Points:
44/47
1 Which of the following contains “machine code”?
The Python interpreter
The keyboard
Python source file
A word processing document
2 Which of the following version of Python was released in February, 2023 by Python.org?
3.13.1 3.12.2 3.12.1 3.13
3 Python files are saved with the extension as ...?
.python .pe .py .pi
4 What is the name of the GUI that comes in-built as an interactive shell with Python?
PGUI Pyshell IDLE PythonSh
5 IDLE stands for ... ?
Indigenous Development Lab Integrated Development Environment
Integrated Developers Local Environment Indie Developers Environment
6 The function to display a specified message on the screen is ... ?
print display run output
7 Which of the following is an assignment operator in Python?
== === >>> =
8 Which of the following is used to initialize multiple variables with a common value?
x = y: y = 33 x = y = z = 33 x = z; y = z; x = 33; x & y & z = 33
9 Comments in Python begin with ...?
{ % * #
10 A user-specified value can be assigned to a variable with this function ...
user enter input value
11 User input is read as ...?
Floating Decimal Text String Boolean Value Integer
12 Output displayed by the print function will add this invisible character at the end of the line by
default ...
\t \n \s \r
13 Multiple values specified in parentheses to print function will display each value separated with
this by default ...
Single Space Double Space A new Line Double Lines
14 Which of the following will provide an ! character as alternative separator for the print function?
sep is ! separate = ! sep >> '!' sep = '!'
15 Which of the following will provide a * character as alternative line ending for the print function?
end to * end as * end = '*' ending = '*'
16 For which type of error does the interpreter halts and reports the error but does not execute the
program?
Semantic error Syntax error Runtime error All type of errors
17 For which type of error does the interpreter runs the program but halts at error and reports the
error as an "Exception"?
Semantic error Syntax error Runtime error All type of errors
18 For which type of error does the interpreter runs the program and does not report an error?
Semantic error Syntax error Runtime error All type of errors
19 What is wrong with the following code:
Syntax errors
Logic errors
Semantic errors
All of the above
20 What will be the output after the following statements?
x=6 y=3 print(x / y)
2.0 2 18 18.0
21What will be the output after the following statements?
x=8 y=2 print(x // y)
4.0 4 16 16.0
22 What will be the output after the following statements?
x=5 y=4 print(x % y)

0 20 1.0 1
23 What will be the output after the following statements?
x=3 y=2 x += y print(x)
3 2 5 1
24 What will be the output after the following statements?
x=5 y=7 x *= y print(x)
7 12 5 35
25 What will be the output after the following statements?
x=3 y=4 print(x*y)
3 4 34 12
26 What will be the output after the following statements?
x = 25 y = 15 x -= y print(x)
10 25 15 -15
27 What will be the output after the following statements?
x = 30 y=7 x %= y print(x)
4 28 2 37
28 What will be the output after the following statements?
x=3 y=7 print(x == y)
y = 7 and x = 3 True x = 3 and y = 3 False
29 What will be the output after the following statements?
x=8 y=6 print(x != y)
y = 6 and x = 8 True x = 6 and y = 6 False
30 What will be the output after the following statements?
x = 83 y = 57 print(x > y)
True False Not given All of these
31 What will be the output after the following statements?
x = 72 y = 64 print(x < y)
True False Not given All of these
32 What will be the output after the following statements?
x = True y = False print(x and y)
True False Not defined x and y
33 What will be the output after the following statements?
x = True y = False print(x or y)
True False Not defined x or y
34 What will be the output after the following statements?
x = True y = False print(not x)
True Flase Not defined not x
35 What will be the output after the following statements?
x = True y = False print(not y)
True False Not defined not y
36 What will be the output after the following statements?
x=2*4+7 print(x)
30 15 22 247
37 What will be the output after the following statements?
x = 7 * (4 + 5) print(x)
63 16 33 35
38 What will the following program print out:
x = 43 x=x+1 print(x)
43 44 x+1
Error because x = x + 1 is not possible mathematically
39 What will be the output after the following statements?
x = '24' + '16' print(x)
40 2416 21 46
40 What will be the output after the following statements?
x = 15 + 35 print(x)
40 153 50 1535
41 What will be the data type of x after the following statement if input entered is 18 ?
x = input('Enter a number: ')
Float String List Integer
42 What will be the data type of y after the following statements if input entered is 50?
x = input('Enter a number: ')
y = int(x)
Float String List Integer
43 What will be the data type of y after the following statements?
x = 71 y = float(x)
Float String List Integer
44 What will be the data type of y after the following statements?
x = 48 y = str(x)
Float String List Integer
45 What will be the output after the following statements?
x=y=z=8 print(y)
x 8 y z
46 What will be the value of x, y and z after the following statement?
x = y = z = 300
All three will have the value of 3.00
All three will have the value of 300.0
All three will have the value of 300
x and y will have arbitrary values, while z will have the value of 300
47 What will be the value of x, y and z after the following statement?
x, y, z = 3, 4, 5
All three will have the value of 3
All three will have the value of 345
x will have the value of 3, y will have the value 4 and z will have the value of 5
x and y will have arbitrary values, while z will have the value of 345

You might also like