WorksheetsIntroduction to Python Programming
Total questions: 12
Worksheet time: 9mins
The <-- assignment operator in pseudocode is replaced by _____ in python
==
( )
=
<-- The symbol is the same
What is the value of M after the following operation:
x = 2
M = pow (2 , 3)
(a)
An instruction is written to determine if the value in a is equal to the value in b.
Choose the correct operator to complete the instruction:
if a ______ b:
<--
=
==
Choose the operators to represent "not equal to" in PYTHON
<>
/=
Not=
!=
What is the output of the following:
a=2
b=3
c=4
a=b
b=a
c=b
print(c)
(a)
Convert the pseudocode statements to python
print "enter name"
read n
Use double quotation and no space
(a)
Convert the pseudocode statement to python
print "enter a whole number"
read num
Use double quotation and no space
(a)
What is the result of the following:
x = 10
m = x % 4
print (m)
(a)
A statement in the program that is not executed and can explain to another programmer what the code is about
(a)
What is the output of the following instruction
name = "KEVIN LU"
n = len(name)
print (n)
(a)
What is the output of the following instructions:
y=3
a=4
n1 = a ** y
print(n1)
(a)
A Microsoft word document is saved with the extension .doc (e.g. My project.doc). What extension is used when saving python programs?
.pyt
.python
.py
.p
