wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Y12 PRE_SANTA mmd

Total questions: 177

Worksheet time: 2hrs 38mins

Name
Class
Date
1.

¬¬A =

a)

A

b)

1

c)

0

d)

¬A

2.

A ∧ A =

a)

A

b)

1

c)

0

d)

¬A

3.

A ∧ ¬A =

a)

A

b)

1

c)

0

d)

¬A

4.

A ∧ 1 =

a)

A

b)

1

c)

0

d)

¬A

5.

A ∧ 0 =

a)

A

b)

1

c)

0

d)

¬A

6.

A v A =

a)

A

b)

1

c)

0

d)

¬A

7.

A v ¬A =

a)

A

b)

1

c)

0

d)

¬A

8.

A v 1 =

a)

A

b)

1

c)

0

d)

¬A

9.

A v 0 =

a)

A

b)

1

c)

0

d)

¬A

10.

A v AB =

a)

A

b)

1

c)

0

d)

¬A

11.

Applying DeMorgan's rule to:

¬(A v B) gives

a)

¬(A v B)

b)

¬A v ¬B

c)

¬A ∧ ¬B

d)

¬(A ∧ B)

12.

Applying DeMorgan's rule to:

¬(A ∧ B) gives

a)

¬(A v B)

b)

¬A v ¬B

c)

¬A ∧ ¬B

d)

¬(A ∧ B)

13.

Simplify the following Boolean expression: ¬B∧¬A∨¬B

a)

¬B∧¬A

b)

¬A∧¬B

c)

¬B∨¬A

d)

¬A∨¬B

e)

¬B

14.
What Boolean operation is represented with ¬?
a)
NOT
b)
AND
c)
OR
d)
XOR
e)
NOR
15.
What Boolean operation is represented with ∧?
a)
AND
b)
OR
c)
XOR
d)
NOT
e)
NOR
16.
What Boolean operation is represented with ∨?
a)
OR
b)
XOR
c)
NOT
d)
NOR
e)
AND
17.
What Boolean operation is represented with ⊕?
a)
XOR
b)
NOT
c)
AND
d)
OR
e)
NOR
18.
Which has the highest order of precedence: AND, OR or NOT?
a)
NOT
b)
AND
c)
OR
d)
XOR
e)
NOR
19.
Complete the Boolean identity: C ∧ C =
a)
C
b)
C V C
c)
¬C
d)
¬C V C
e)
¬C ∧ ¬C
20.
Simplify the following Boolean expression: (C ∨ (B ∨ ¬B)) ∧ D
a)
D
b)
C
c)
B
d)
¬C
e)
¬D
21.
Complete the Boolean identity: B ∧ 1 =
a)
B
b)
¬B
c)
B ∧ B
d)
B V B
22.
Apply one of De Morgan’s Laws to the following Boolean expression: ¬A ∧ ¬B
a)
¬(A∨B)
b)
¬(A∧B)
c)
¬(A∨¬B)
d)
(¬A∨B)
e)
(A∨B)
23.

Apply one of De Morgan’s Laws to the following Boolean expression: ¬(A∧C)

a)

¬A ∨ ¬C

b)

¬(A∨C)

c)

¬(A∧C)

d)

¬(A∨¬C)

e)

(¬A∨C)

24.
Apply a distributive rule to the following Boolean expression: B ∧ (A ∨ C)
a)
B ∧ A V B ∧ C
b)
(B V A) ∧ (B V C)
c)
B V A ∧ B V C
d)
B ∧ A
e)
B V C
25.
1.Which of the following statement is FALSE about logic gates?
a)
A.Logic gates are the building blocks of electronic circuits.
b)
B.It is used in computer components like memory.
c)
C.A combination of logic gates is called logic circuit.
d)
D.A logic gate understands binary language.
e)
E.None of the above
26.
2.What is a truth table?
a)
A.A table that denotes the different outputs of the logic gates or circuit with respect to different inputs.
b)
B.A table that represents how logic gates are combined to form a logic circuit.
c)
C.A table that shows the input combinations that result in a binary output 1 in a logic gate.
27.
3.A logic circuit has 4 inputs. How many output combinations are possible?
a)
A.8
b)
B.16
c)
C.32
d)
D.4
28.
4.A logic circuit has n inputs. How many output combinations are possible?
a)
A.2×n
b)
B.2n
c)
C.n÷2
29.
5.Which of the following is FALSE about the NOT gate?
a)
A.Output of NOT is complementary to the input
b)
B.When the input to NOT gate is 0, the output is 1.
c)
C.A NOT gate has two input signals and an output signal.
d)
D.None of the above
30.
6.When is the output for AND gate TRUE?
a)
A.When both inputs are TRUE.
b)
B.When at least one of the inputs is TRUE.
c)
C.When both inputs are FALSE
d)
D.When at least one of the inputs is FALSE.
31.
7.When is the output for OR gate TRUE?
a)
A.When both inputs are TRUE.
b)
B.When at least one of the inputs is TRUE.
c)
C.When both inputs are FALSE
d)
D.When at least one of the inputs is FALSE.
32.
8.An AND gate has two inputs A and B. What is the Boolean expression for this logic gate?
a)
A.A^B
b)
B.A˅B
c)
C.¬A^B
33.

9.What is the Boolean expression for this logic gate?

a)

A.X=A^B

b)

B.X=A˅B

c)

C.X=A*B

34.

10.What is the Boolean expression for this logic gate?

a)

A.X=˅A

b)

B.X=&A

c)

C.X=¬A

35.
11.What is a logic circuit?
a)
A.Combination of logic gates that performs a specific function.
b)
B.Combination of logic gates that understands both binary and decimal number systems.
c)
C.Combination of logic gates that understands decimal number system.
36.

12.How many intermediate outputs do you require to realise the truth table of this logic circuit?

a)

A.1

b)

B.2

c)

C.3

d)

D.4

37.

13.What is the output of gate 1, when A=1 and B=0?

a)

A.0

b)

B.1

38.

14.What is the output of gate 2, when C=1 and D=0?

a)

A.0

b)

B.1

39.

15.What is the output (X) of gate 3, when A=1, B=1, C=1 and D=0?

a)

A.0

b)

B.1

40.

16.What is the output (X) of gate 3, when A=0, B=1, C=1 and D=1?

a)

A.1

b)

B.0

41.

17.When is the output (X) of gate 3 FALSE?

a)

A.A=1, B=0, C=1 and D=1

b)

B.A=1, B=1, C=0 and D=1

c)

C.A=1, B=1, C=0 and D=0

d)

D.A=1, B=0, C=0 and D=0

42.

18.What is the Boolean expression of the circuit shown?

a)

A.X = (A˅B) ^ (C^D)

b)

B.X = (A˅B) ^ (C˅D)

c)

C.X = (A^B) ˅ (C^D)

d)

D.X = (A^B) ˅ (C˅D)

43.
19.How many output bits are required for a two-bit binary adder?
a)
A.1
b)
B.2
c)
C.3
44.
20.Which of the following is the correct logical expression for sum of a 2-bit binary adder?
a)
A.Sum S = (A AND B) OR ((NOT A) AND (NOT B))
b)
B.Sum S = ((NOT A) AND B) OR (A AND (NOT B))
c)
C.Sum S = ((NOT A) OR B) AND (A OR (NOT B)).
45.

Which of the following logic statement holds good for this truth table?

a)

A.X= (A AND B) OR ((NOT A) AND (NOT B))

b)

B.X= (A OR B) AND ((NOT A) OR (NOT B))

c)

C.X= (A AND B) OR (NOT (A AND B))

46.

Which of the following logic statement holds good for this truth table?

a)

A.X= A˅B˅C

b)

B.X= (A^B^¬C) ˅ (A^¬B^C) ˅ (¬A^¬B^C)

c)

C.X= (A^B^C) ˅ (A^B^C) ˅ (A^B^C)

d)

D.X= (A^B^¬C) ˅ (A^¬B^C) ˅ (¬A^B^C)

47.

Electronic components used to perform Boolean Algorithms.

a)
Logic Gates
b)

Adders

c)
De Morgan's Law
d)

Flip-flops

e)

Algorithms

48.
An equation made up of Boolean operations.
a)

Boolean expression

b)
Logic Gates
c)
NOT
d)
De Morgan's Law
e)
OR
49.
A combination of logic gates.
a)
Logic circuit
b)
Boolean expressions
c)
Logic Gates
d)
NOT
e)
De Morgan's Law
50.
A memory unit that can store one bit.
a)
FLIP FLOP
b)
Logic circuit
c)
Boolean expressions
d)
Logic Gates
e)
NOT
51.

A memory unit that changes state with each pulse of the clock from 0 to 1.

a)
Edge triggered d type flip flop
b)

Adder

c)
Logic circuit
d)
Boolean expressions
e)
Logic Gates
52.
A device that generates a signal used to synchronise the components of a computer.
a)
Clock
b)
Edge triggered d type flip flop
c)
FLIP FLOP
d)
Logic circuit
e)
Boolean expressions
53.
Part of the processor that processes and manipulates data.
a)
Arithmetic Logic Unit
b)
Clock
c)
Edge triggered d type flip flop
d)
FLIP FLOP
e)
Logic circuit
54.
A circuit that performs addition using inputs from A and B only.
a)
Half adder
b)
Arithmetic Logic Unit
c)
Clock
d)
Edge triggered d type flip flop
e)
FLIP FLOP
55.
A circuit that performs addition using inputs from A and B plus a carry bit.
a)
Full Adder
b)
Half adder
c)
Arithmetic Logic Unit
d)
Clock
e)
Edge triggered d type flip flop
56.
used to store 0 or 1 depending on the result binary addition.
a)
Carry bit
b)
Full Adder
c)
Half adder
d)
Arithmetic Logic Unit
e)
Clock
57.
An equation made up of Boolean operations.
a)
Boolean Expression
b)
Carry bit
c)
Full Adder
d)
Half adder
e)
Arithmetic Logic Unit
58.

Result is true if any of the inputs false.

a)
NAND gate
b)
Boolean Expression
c)
Carry bit
d)
Full Adder
e)
Half adder
59.
A method of representing/calculating the result of every possible combination of inputs in a Boolean expression.
a)
Truth table
b)
NAND gate
c)
Boolean Expression
d)
Carry bit
e)
Full Adder
60.
Result is true if both inputs are true.
a)
AND gate
b)
Truth table
c)
NAND gate
d)
Boolean Expression
e)
Carry bit
61.
Result is true if both inputs are false.
a)
NOR Gate
b)
AND gate
c)
Truth table
d)
NAND gate
e)
Boolean Expression
62.
a single Boolean function.
a)
Boolean operation
b)
NOR Gate
c)
AND gate
d)
Truth table
e)
NAND gate
63.
Boolean operation that is true if either input is true but not if both inputs are true.
a)
XOR
b)
Boolean operation
c)
NOR Gate
d)
AND gate
e)
Truth table
64.
Boolean operation that outputs true if either of its inputs are true.
a)
OR
b)
XOR
c)
Boolean operation
d)
NOR Gate
e)
AND gate
65.
a process for simplifying Boolean expressions.
a)
De Morgan's Law
b)
OR
c)
XOR
d)
Boolean operation
e)
NOR Gate
66.
Boolean operation that inverts the result so true becomes false and false becomes true.
a)
NOT
b)
De Morgan's Law
c)
OR
d)
XOR
e)
Boolean operation
67.
Select the best description to explain what a linear search algorithm is.
a)
Put the elements in order, check each item in turn.
b)
Put the elements in order, compare with the middle value, split the list in order and repeat.
c)
Elements do not need to be in order, check each item in turn.
d)
Elements do not need to be in order, compare to the middle value, split the list in order and repeat
68.

Select the best description to explain what a binary search algorithm is.

a)

Put the elements in order, check each item in turn.

b)

Put the elements in order, compare with the middle value, split the list in order and repeat.

c)

Elements do not need to be in order, check each item in turn.

d)

Elements do not need to be in order, compare to the middle value, split the list in order and repeat

69.
A linear search is to be performed on the list:
12   6   8  1  3
How many comparisons would it take to find number 1?
a)
1
b)
2
c)
3
d)
4
70.
A binary search is to be performed on the list:
3  5  9  10  23
How many comparisons would it take to find number 9?
a)
0-1
b)
2-3
c)
4-5
d)
I can't find the number 9
71.
A binary search is to be performed on the list:
1  5  10  13  48  68  100  101
How many comparisons would it take to find number 101?
a)
0-1
b)
1-2
c)
3-4
d)
4-5
72.
Describe an advantage of a linear search algorithm
a)
Data does not need to be in order.
b)
Performs well over large ordered lists.
c)
Can only work on an ordered list.  If unordered must use a linear search.
d)
Slow with large data sets.
73.
Describe a disadvantage of a linear search algorithm
a)
Data does not need to be in order.
b)
Performs well over large ordered lists.
c)
Can only work on an ordered list.  If unordered must use a linear search.
d)
Slow with large data sets.
74.
Describe an advantage of a binary search algorithm
a)
Data does not need to be in order.
b)
Performs well over large ordered lists.
c)
Can only work on an ordered list.  If unordered must use a linear search.
d)
Slow with large data sets.
75.
Describe a disadvantage of a binary search algorithm
a)
Data does not need to be in order.
b)
Performs well over large ordered lists.
c)
Can only work on an ordered list.  If unordered must use a linear search.
d)
Slow with large data sets.
76.
Describe an advantage of a linear search algorithm
a)
If the criteria matches the last item in list, entire list has to be checked.
b)
Simple to code than a binary search.
c)
Quicker than a linear search.
d)
Can only work on an ordered list.  If unordered must use a linear search.
77.
Describe a disadvantage of a linear search algorithm
a)
If the criteria matches the last item in list, entire list has to be checked.
b)
Simple to code than a binary search.
c)
Quicker than a linear search.
d)
Can only work on an ordered list.  If unordered must use a linear search.
78.
Describe an advantage of a binary search algorithm
a)
If the criteria matches the last item in list, entire list has to be checked.
b)
Simple to code than a binary search.
c)
Quicker than a linear search.
d)
Can only work on an ordered list.  If unordered must use a linear search.
79.
Describe a disadvantage of a binary search algorithm
a)
If the criteria matches the last item in list, entire list has to be checked.
b)
Simple to code than a binary search.
c)
Quicker than a linear search.
d)
More complicated to code than a linear search.
80.
Define the term abstraction within computational thinking 
a)
Adding together numbers
b)
Taking a real world problem and designing a computer program that exactly replicates every part of that problem in the computer
c)
Performing multiple calculations on a list of variables
d)
Representing real world problems in a computer program, using symbols and removing unnecessary elements
81.
Define the term decomposition within computational thinking
a)
The breaking down of a program until it no longer exists
b)
The creation of music that can be played on a computer
c)
The breaking down of a problem into smaller problems
d)
The breaking down of waste to make compost
82.
Identify which statement describes algorithmic thinking 
a)
Thinking like a computer
b)
Writing binary numbers 
c)
Identifying the steps involved in solving a problem 
d)
Identifying what problems need to be solved 
83.
Identify the search performed by the algorithm above...
a)
Linear
b)
Binary
c)
Both linear and binary 
d)
Neither, it does not work
84.
What command is this shape for?
a)
START / STOP
b)
INPUT / OUTPUT
c)
PROCESS
d)
DECISION
85.
What does this shape represent?
a)
Input/Output
b)
Decision
c)
Process
d)
Start/Stop
86.
What does this shape represent?
a)
Decission
b)
Process
c)
Input/Output
d)
Start/End
87.
What's missing ?
a)
On/Off
b)
Pink/Blue
c)
Hello/Goodbye
d)
Yes/No
88.
What command is this shape for?
a)
References another part of the program
b)
Data that is going in as input or coming out as output
c)
Processing something - a calculation or storing something into a variable
d)
Shows the direction of the program
89.
What will be displayed as output?
a)
10
b)
20
c)
30
d)
40
90.
Assume n1 = 10 ... n2 = 2 ... n3 = 2
What will be displayed as output?
a)
10
b)
20
c)
30
d)
40
91.
Assume n1 = 10 ... n2 = 20
What will be displayed as output?
a)
10
b)
20
92.
What is the correct definition of an algorithm?
a)
An algorithm is a step by step instructions to solve a problem.
b)
An algorithm is a process of baking bread.
c)
An algorithm is a software used to compute numbers.
d)
An algorithm is the process of breaking problems.
93.
What is the difference between a flowchart and pseudocode? 
a)
A flowchart is diagramatic whilst pseudocode is written in a programming language (eg. Pascal or Java) 
b)
A flowchart is textual but pseudocode is diagrammatic 
c)
A flowchart is a diagrammatic description of an algorithm whilst pseudocode is a textual description of an algorithm 
d)
A flowchart and pseudocode are the same thing 
94.

How do bubble sorts work?

a)

They split the list to single elements before piecing them back together, one sublist at a time.

b)

Each item in the list is compared with the following item starting with the last value till the first.

c)

Taking one item at a time from an unsorted list, each new item is compared with the previous until its place is found.

d)

Each item in the list is individually compared with the following item starting with the first value till the last.

95.

What is an advantage of a bubble sort?

a)

It is difficult to implement.

b)

It is fast.

c)

It uses less memory.

d)

It is easier to implement and follow.

96.
What is the maximum number of comparisons if there are 5 elements to sort?
a)
10
b)
2
c)
5
d)
20
97.

How do you calculate the maximum number of passes/iterations? Where n = number of elements in a list.

a)

n - 1

b)

n + 1

c)

n(n+1)

d)

n(n-1)

98.

How many passes are required to sort a list with 5 elements?

a)

5

b)

4

c)

10

d)

2

99.

The following list is to be sorted using a bubble sort:

12 6 8 1 3

What will the list look like after the first iteration/run through the list?

a)

6 8 1 3 12

b)

6 12 1 8 3

c)

1 3 6 8 12

d)

6 8 1 12 3

100.

Why does a bubble sort do a final pass even when the data is in the correct order?

a)

To save the data.

b)

It does not recognise that the data is in order until the final pass requires no changes.

c)

It needs to do this to put the data back in to a list.

d)

To annoy the user.

101.

What is a disadvantage of a bubble sort?

a)

It takes a long time to implement.

b)

It is difficult to follow and understand.

c)

It uses less memory.

d)

It requires many operations to complete.

102.

How do merge sorts work?

a)

They split the list to single elements before piecing them back together, one sublist at a time.

b)

Each item in the list is compared with the following item starting with the last value till the first.

c)

Taking one item at a time from an unsorted list, each new item is compared with the previous until its place is found.

d)

Each item in the list is individually compared with the following item starting with the first value till the last.

103.

The following two lists are to be merged, which element first goes into the new merged list?

List 1

2 4 7 9

List 2

1 6 8 12

a)

0

b)

1

c)

2

d)

3

104.

The following two lists are to be merged, which element will be in position 5 in the new merged list?

List 1

2 4 7 9

List 2

1 6 8 12

a)

8

b)

7

c)

6

d)

4

105.

Which of the following is an advantage of merge sorting?

a)

It is cheap (computationally).

b)

It's easy to understand.

c)

It speeds up sorting slow-access data e.g. tape drive or hard disk.

d)

Good for sorting slow-access data e.g. tape drive or hard disk.

106.

For which of the problems would the bubble sort algorithm provide an appropriate solution. Choose all that apply.

a)

Arranging a deck of cards from the lowest to the highest value cards.

b)

Looking up a name in the phone book.

c)

Sorting a stack of paper money into denominations -- i.e., £5, £10, £20 etc.

d)

Sorting a basket of laundry into socks, shirts, shorts, and sheets.

e)

Arranging books on a bookshelf by author's last name.

107.

For what purpose would a merge sort algorithm be used?

a)

To list items alphabetically.

b)

To reorder a single list.

c)

To combine identical lists together.

d)

To reorder multiple lists into a singular ordered list.

108.

Where would a merge sort be used?

a)

To arrange files in a cupboard.

b)

To arrange data in a computer folder.

c)

To sort data on the fly.

d)

To sort data that is too large to store in memory.

109.

What is a disadvantage of merge sort?

a)

It can take up to half the amount of memory than that of the original list.

b)

It is the best for sorting data that is normally accessed sequentially.

c)

It can take up to double the amount of memory than that of the original list.

d)

It is the worst at sorting data that is normally accessed sequentially.

110.

Which line best represents the time complexity n!

a)

Orange

b)

Blue

c)

Green

d)

Red

e)

Pink

111.

Which line best represents the time complexity log n

a)

Orange

b)

Blue

c)

Green

d)

Red

e)

Pink

112.

Which line best represents the time complexity n

a)

Orange

b)

Blue

c)

Green

d)

Red

e)

Pink

113.

Find the slowest time complexity

a)

O (n)

b)

O (n^2)

c)

O (n!)

d)

O (2^n)

114.

Indicate constant time complexity in terms of Big-O notation

a)

O(n)

b)

O(1)

c)

O(log n)

d)

O (n^2)

115.

Which notation is consistent for every execution?

a)

O (n)

b)

O (n^2)

c)

O (1)

d)

O (2^n)

116.

Which notation grows in proportion to the size of the input

a)

O (n)

b)

O (n^2)

c)

O (1)

d)

O (2^n)

117.

Which notation would you usually use for a nested loop?

a)

O (n)

b)

O (n^2)

c)

O (1)

d)

O (2^n)

118.

Indicate polynomial time complexity in terms of big-O notation

a)

O (n!)

b)

O (1)

c)

O (n^2)

d)

O (log n)

119.

When calculating the Big-O for an algorithm, which of the following rules is not true?

a)

Focus on the dominant term

b)

Disregard any constants

c)

Focus only on polynomials

d)

Count the number of assignments

120.

A linear function takes the form

a)

f(n) = an + b

b)

f(n) = an2 +bn + c

c)

f(n) = alog2n

d)

f(n) = a + b

121.

A quadratic function takes the form

a)

f(n) = an + b

b)

f(n) = an2 +bn + c

c)

f(n) = alog2n

d)

f(n) = a + b

122.

A logarithmic function takes the form

a)

f(n) = an + b

b)

f(n) = an2 +bn + c

c)

f(n) = alog2n

d)

f(n) = a + b

123.
a)

1 + 3n + n

b)

3 + n

c)

3n

d)

1 + 3n

124.

The graphs shows

a)

O(n^2)

b)

O(n)

c)

O(log n)

d)

O(1)

e)

O(n log n)

125.

The graphs shows

a)

O(n^2)

b)

O(n)

c)

O(log n)

d)

O(1)

e)

O(n log n)

126.

The graphs shows

a)

O(n^2)

b)

O(n)

c)

O(log n)

d)

O(1)

e)

O(n log n)

127.

The graphs shows

a)

O(n^2)

b)

O(n)

c)

O(log n)

d)

O(1)

e)

O(n log n)

128.

The graphs shows

a)

O(n^2)

b)

O(n)

c)

O(log n)

d)

O(1)

e)

O(n log n)

129.

No matter how large the input is, the time taken doesn’t change.

a)

Quadratic

b)

Linear

c)

Logarithmic

d)

Constant

e)

Linearithmic

130.

For every element, you are doing a constant number of operations, such as comparing each element to a known value.

a)

Quadratic

b)

Linear

c)

Logarithmic

d)

Constant

e)

Exponential

131.

The time taken will double with each additional element in the input data set.

a)

Quadratic

b)

Linear

c)

Logarithmic

d)

Constant

e)

Exponential

132.

Which is correct for increasing time complexity.

a)

O(1), O(log n), O(n), O(n log n), O(n^2)

b)

O(log n), O(n log n), O(n)

c)

O(n), O(n log n), O(n^2)

d)

O(1), O(n), O(log n)

133.

The red line on the graph shows which Big O time complexity?

a)

Linear

b)

Linearithmic

c)

Logarithmic

d)

Constant

e)

Quadratic

134.

The yellow line on the graph shows which Big O time complexity?

a)

Linear

b)

Linearithmic

c)

Logarithmic

d)

Constant

e)

Quadratic

135.

What algorithm does Google Maps use?

a)

Dijkstra's

b)

Distance-Vector

c)

A*

d)

D*

136.

Select all correct applications of a shortest-path algorithm

a)

Navigation

b)

NPC control in gaming

c)

Sending data packets

d)

Financial investment choices

e)

AI neural network training

137.

Which type of queue is used in Dijkstra's Algorithm?

a)

Priority

b)

Circular

c)

Linear

138.

Which of the following could a weighted node represent within a path finding algorithm?

a)

Time

b)

Cost

c)

Steps

d)

Distance

139.

Starting at node B, what is the minimum cost to reach node F?

a)

8

b)

9

c)

4

d)

6

140.

Starting at node A, which is the shortest path to reach node E?

a)

a-b-e

b)

a-c-e

c)

a-c-d-e

d)

a-c-d-b-e

141.
I want to allow the program to repeatedly ask the user to enter their guess if it does not equal the answer...Which option do I use?
a)
while guess == answer:
    guess=input()
b)
while answer != guess:
guess=input()
c)
while answer =! guess:
guess=input()
d)
while guess != answer:
guess=input()
142.

Tara has written a "Hide and Seek Simulator" - what will happen when she runs it?

a)

It will print "1,2,3,4,5,6,7,8,9,10 Coming ready or not!"

b)

The program will not run

c)

It will print "1,2,3,4,5,6,7,8,9,11 Coming ready or not!"

d)

It will print ("10 Coming ready or not!")

143.

What does the following code do? myAge = int (myAge)

a)

Converts the var (variable) myAge to a string

b)

Converts the var (variable) myAge to a integer

c)

Converts the var (variable) myAge from a integer to a string

d)

Converts the var (variable) myAge to if statement

144.
What does the term 'debug' mean?
a)
Identify errors and fix them.
b)
Making a calculation
c)
A set of instructions
d)
Looking at code
145.

Which of the following is an advantage of using local variables?

a)

They allow the variable to be used throughout the whole program

b)

They allow variable identifiers to be reused each time

c)

They are easier to program than global variables

d)

A wider range of data types can be used

146.

What term is used to describe data passed into/out of a program?

a)

Variable

b)

Loop

c)

Constant

d)

Parameter

147.

Leo wants to create a subroutine that will roll a dice. Which syntax is correct?

a)

def dice roll ():

b)

def diceroll ()

c)

def diceroll ():

d)

def diceroll []:

148.

What would the output be from the program shown here? (assuming that the user enters "John" and "Smith"

a)

John

b)

Smith

c)

John Smith

d)

Error

149.

What would the output be from this program?

a)

Error

b)

Hello

c)

Hello, World

d)

World

150.

What is the difference between a subroutine and a function?

a)

They are the same thing

b)

A subroutine passes values back out to the program, a function does not

c)

A function passes values back out to the program, a subroutine does not

d)

A function can run without being called

151.

What will be the output of this program if the user enters "Han" and then "Solo"?

a)

An error

b)

Nothing

c)

first surname

d)

Han Solo

152.

Which of the following statements is not true?

a)

Functions/subroutines are examples of reusable code

b)

Functions and subroutines are always appropriate in programs

c)

Using functions/subroutines make it easier to "deconstruct" a problem into smaller pieces

d)

They can make programs easier to read and understand

153.

What would the output be for the following program if the user enters 4 and 6?

a)

10

b)

14

c)

16

d)

error

154.
Which of the following best describes the order in which these lines are processed in Python?
a)
4, 1, 2
b)
4, 2, 1
c)
1, 2, 3, 4
d)
3, 1, 2
155.
How do you correctly call this function
a)
def(1)
b)
x=square( )
c)
defSquare(4)
d)
x=square(5)
156.

Which of the following is NOT a reason that loops are useful when writing code?

a)

Loops help us write the same program with less lines of code.

b)

Loops let us make shapes of multiple sizes.

c)

Loops make it easier to alter code once it’s written.

d)

Loops make our code easier to read.

157.

If Tracy starts at the left edge of the canvas and moves forward 50 pixels, how many times will this code need to be repeated to have Tracy reach the right edge of the canvas?

a)

4 times

b)

8 times

c)

12 times

d)

16 times

158.

If I use the command right(180), which way will Tracy turn?

a)

She will turn in a circle.

b)

She will turn around.

c)

She will turn to face up

d)

She will turn to face left

159.

What is a program?

a)

A series of a step-by-step instructions that tell a computer how to solve a task

b)

A video that is watched on a computer

c)

A flowchart written on a computer

d)

The make and model of a computer

160.
What is syntax?
a)
Syntax is the word used to describe an error
b)
Syntax is the rules of the programming language
c)
It is used to read information
d)
It is used to output information 
161.
What will the output be from the following code?
print("3+4")
a)
7
b)
3+4
c)
34
d)
SyntaxError
162.

What command is used to access a library of functions?

a)

import

b)

load

c)

get

d)

library

163.

What are the 3 programming constructs?

a)

input ,process, output

b)

sequence, selection, iteration

c)

variable, constant, value

d)

code, test, review

164.

Consider the file "d://test.txt" with the contents as given below:

Hi there,

I am loving Python.

Python is Simple

Choose the correct output from the above code snippet from the given options:

a)

Read String is : Hi there,

b)

Read String is : Python is simple.

c)

Syntax error

d)

Read String is : Hi there,

I am loving Python.

Python is simple.

165.

Consider the file "d://test.txt" with the contents as given below:

Hi there,

I am loving Python.

Python is Simple

Choose the correct output from the above code snippet from the given options:

a)

Read String is : Hi there

b)

Read String is : Hi there,

c)

Syntax error

d)

Hi there,

I am loving Python.

Python is simple.

166.

Consider a file test.txt in D Drive with the following contents:

I Love Python

Choose the output for the following Python code from the given options(Select all applicable):

a)

Stmt2 prints the contents of the file test.txt

b)

Stmt5 will print number of tokens(words) in the file separated by a space ' '

c)

Stmt6 should be uncommented to close the open file.

d)

Stmt3 results in an error

167.

Consider a file read.txt in D Drive with the following contents:

Banana

Apple

Grapes

Choose the output for the following Python code from the given options:

a)

{}

b)

{0: 'Banana', 1: 'Apple', 2: 'Grapes'}

c)

[0: 'Banana', 1: 'Apple', 2: 'Grapes']

d)

{'Banana':0, 'Apple':1, 'Grapes':2}

168.

Consider a file read.txt in D Drive with the following contents:

Banana

Apple

Grapes

Choose the output for the following Python code from the given options:

a)

[]

b)

['Banana', 'Apple', 'Grapes']

c)

{'Banana', 'Apple', 'Grapes'}

d)

Error

169.

Consider a list, fruits=["Mango", "Banana", "Guava", "Strawberry"]. Match the following:

a. fruits[-4:]

b. fruits[-2:]

c. fruits[-4:-1]

d. fruits[1:4]

Select the correct answer for a, b, c & d

a)

['Banana', 'Guava', 'Strawberry']

b)

['Mango', 'Banana', 'Guava', 'Strawberry']

c)

['Mango', 'Banana']

d)

['Mango', 'Banana', 'Guava']

e)

['Guava', 'Banana', 'Mango']

170.

Assume the following list definition:

a = ['foo', 'bar', 'baz', 'qux', 'quux', 'corge']

a)

print(a[4::-2])

b)

a[:] is a

c)

max(a[2:4] + ['grault'])

d)

print(a[-5:-3])

171.

List a is defined as follows:

a = ['a', 'b', 'c']

Which of the following statements adds 'd' and 'e' to the end of a, so that it then equals ['a', 'b', 'c', 'd', 'e']:

a)

a += 'de'

b)

a += ['d', 'e']

c)

a.append(['d', 'e'])

d)

a[len(a):] = ['d', 'e']

e)

a.extend(['d', 'e'])

172.

What gets printed?

names = ['Amir', 'Barry', 'Chales', 'Dao']

print(names[-1][-1])

a)

A

b)

r

c)

Amir

d)

Dao

e)

o

173.

What gets printed from the above piece of code?

a)

11

b)

12

c)

21

d)

22

e)

33

174.

names1 = ['Amir', 'Barry', 'Chales', 'Dao']

loc = names1.index("Edward")

print(loc)

a)

-1

b)

0

c)

4

d)

Edward

e)

An exception is thrown

175.

Which of the following are true of Python lists?

a)

These represent the same list:['a', 'b', 'c'] ['c', 'a', 'b']

b)

A given object may appear in a list more than once

c)

All elements in a list must be of the same type

d)

A list may contain any type of object except another list

e)

There is no conceptual limit to the size of a list

176.

You have a list a defined as follows:

a = [1, 2, 7, 8]

Write a Python statement using slice assignment that will fill in the missing values so that a equals [1, 2, 3, 4, 5, 6, 7, 8].

(a)  

177.

List a is defined as follows:

a = [1, 2, 3, 4, 5]

Select all of the following statements that remove the middle element 3 from a so that it equals [1, 2, 4, 5]:

a)

a[2:2] = []

b)

del a[2]

c)

a[2] = []

d)

a[2:3] = []

e)

a.remove(3)