NEW
Font size
WorksheetsFUNDAMENTAL in PROGRAMMING
Total questions: 52
Worksheet time: 39mins
Is python an interpreter or compiler programming language?
Compiler
Interpreter
Python uses indentation to block code into chunks
True
False
Python correct naming convention for constants is?
firstName
First_Name
FIRST_NAME
firstname
Python correct naming convention for variables is?
new_user25
NewUser25
25_new_user
25NewUser
NEWUSER25
What is the Python built-in function used to display numbers and text on the screen?
input
output
command
If you want to create an empty list called colours in Python, which of the following is correct?
colours = [ ]
colours = ( )
colours = { }
colours = <>
What will the output be from the following Python code?
print(Hello world!)
Hello world!
SyntaxError
Hello world
print(Hello world!)
What would this print?
What is the Python built-in function to converts a number to a string?
str()
int()
parseInt()
convert
Which of these is correct Python conditional statement?
IF answer == "Yes":
if answer == "Yes"
if answer == "Yes":
if answer = "yes":
Which of the following is used in Python to calculate ten squared?
Which python operator means 'less than or equal to'?
>=
>
<
<=
What is the value of the expression 100 / 25?
4
4.0
"4.0"
'4.0'
What is the output of the following code :
print 9//2
4.5
4.0
4
3
Which is the correct operator for power(x^y)?
X^y
X**y
X^^y
None of the mentioned
Which one of these is floor division?
/
//
%
None of the mentioned
What is the answer of this expression, 22 % 3 is?
7
1
0
5
x = 4.5
y = 2
print(x//y)
2.0
2
9
9.0
x = 5
print(x > 3 and x < 10)
True
False
What is the output?
condition
True
Program has a syntax error.
3 > 2
What is the output?
more than 7
more than 23
spam
7
What is the output?
250.0
200.0
300.0
350.0
What is the output?
next
stop
next
stop
syntax error - program doesn't work
What is the output?
3
3
7
3
5
7
7
What is the output?
level 3
level 3
level 1
level 3
level 1
NIL
level 3
level 2
level 1
NIL
Given the nested if-else below, what will be the value x when the code is executed successfully.
0
4
2
3
Which condition is a logic error (will not run properly)?
x>=1 AND x<=100
1<=x<=100
1>x>100
x<1 OR x>100
In a Python program, what would be the ending value of total in the WHILE LOOP code?
0
5
2
20
In a Python program, what would be the ending value for y in the WHILE LOOP code?
5
51
10
3
What will this code do?
Print Numbers 1-11
Print Numbers 1-10
Print Numbers 2-10
Print Error
What will be the output of this code?
1,2,3,4,5,6,7,8,9,10,11,12
0,2,4,6,8,10
2,4,6,8,10,12
2,4,6,8,10
Look at the following code, what will it generate
1,2,3,4,5,6,7,8,9,10,11,12
0,1,2,3,4,5,6,7,8,9,10,11,12
1,2,3,4,5,6,7,8,9,10,11,12,13
0,1,2,3,4,5,6,7,8,9,10,11,12,13
what is the name of the variable used in the following code?
counter
for
#
