Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Assessment block 2 programming Edexcel

Total questions: 30

Worksheet time: 19mins

Name
Class
Date
1.
What gate is this truth table for?
a)
AND
b)
OR
c)
NOT
d)
THE 
2.
What gate is this table for?
a)
AND
b)
OR
c)
NOT
d)
NOR
3.
What gate is this table for?
a)
AND
b)
XOR
c)
OR 
d)
NOT
4.

What is this diagram called?

a)

Truth Table

b)

Gate Table

c)

Output Table

d)

Input Table

5.
Variables cannot be changed.
a)
False
b)
True
6.
Constants cannot be changed.
a)
True
b)
False
7.
Comparison Operators
What is >= ?
a)
Greater than
b)
Less than
c)
Greater than or equal to
d)
Less than or equal to
8.
Comparison Operators
What is < ?
a)
Greater than
b)
Less than
c)
Greater than or equal to
d)
Less than or equal to
9.

Comparison Operators

What is A > B?

a)

A greater than B

b)

A less than B

c)

Greater than or equal to

d)

Less than or equal to

10.
Comparison Operators
What is != ?
a)
Equal to
b)
Equal value and equal type
c)
Not equal
d)
Not equal value or not equal type
11.

What does the isdigit() function do in Python?

a)

Returns True if all the characters in the string are in capital letters

b)

Returns True if all the characters in the string are in small letters

c)

Returns True if the string contains only spaces

d)

Returns True if all the characters in the string are digits

12.

Which code would get the characters from position 2 to position 5 (not included).

a)

x = txt[2:5]

b)

x = txt[1:5]

c)

x = txt[1:4]

d)

x = txt[0[:4]

13.

Convert the value of txt to upper case.

a)

x = txt.upper()

b)

x = txt.lower()

c)

x = upper(txt)

d)

x = upper.txt()

14.

What is the result of 'Char(65)'?

a)

The number 65

b)

The character 'A'

c)

The ASCII value 65

d)

The string '65'

15.

What is the correct way to convert a string to lowercase in Python?

a)

.lower()

b)

.lowercase()

c)

.small()

d)

.toLower()

16.

How is the condition for a while loop evaluated in Python?

a)

The condition for a while loop in Python is evaluated before each iteration.

b)

The condition for a while loop in Python is evaluated only once at the beginning.

c)

The condition for a while loop in Python is not evaluated at all.

d)

The condition for a while loop in Python is evaluated after each iteration.

17.

Explain the difference between 'while' and 'for' loops in Python.

a)

The 'while' loop is used for iterating over a sequence, while the 'for' loop is based on a condition.

b)

The 'while' loop is only used for strings, while the 'for' loop is used for numbers.

c)

The 'while' loop is based on a condition, while the 'for' loop is based on iterating over a sequence.

d)

The 'while' loop is used for counting, while the 'for' loop is based on iterating over a sequence.

18.

if len(password) < 8:

print ("Your password is not valid!")

This is an example of :

a)
Sequence
b)
Selection
c)
Iteration
19.

What will be the output after the following statements?

a)

true

b)

not false

c)

false

d)

not true

e)

error

20.

Example of ...?

a)

Nested selection

b)

Nested loop

c)

Repetition

d)

Iteration

21.

If the user enters the colour: black and the suit: hearts. What will the output be of this program?

a)

My card is a match

b)

My card is not a match

22.

What is the output of 'Hello'.length?

a)

Hello World

b)

6

c)

4

d)

5

23.

What does the 'strip()' method do in Python?

a)

The 'strip()' method removes leading and trailing whitespace from a string.

b)

The 'strip()' method splits a string into a list of words.

c)

The 'strip()' method converts a string to uppercase.

d)

The 'strip()' method adds whitespace to a string.

24.

s=lower("INDIA)

print(s)

the output will be:

a)

India

b)

india

c)

INDIA

d)

INDIA

25.

For strings, the + operator represents

a)

Concatenation

b)

Addition

c)

Appending

d)

Recantation

26.
What does this symbol represent?
a)
Start
b)
Sub
c)
Decision
d)
Process
27.
What does this shape represent?
a)
Input/Output
b)
Decision
c)
Process
d)
Start/Stop
28.
What is the Output if the user enters:
Yes
a)
Leave umbrella at home
b)
Take an umbrella
29.
What is this symbol used for in a flowchart?
a)
A decision/question
b)
A task to carry out
30.

What data type would True and False be

a)

Integer

b)

String

c)

Boolean

d)

Float/Real