wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Artificial Intelligence Quiz1

Total questions: 26

Worksheet time: 21mins

Name
Class
Date
1.
if your age is 14 what will the chatbot tell you that it's age is?
a)
13
b)
14
c)
15
d)
16
2.
What is the word (command) used to display numbers and text on the screen?
a)
print
b)
input
c)
output
d)
command
3.
What is a variable?
a)
A box(memory location) where you store values
b)
a type of graphics
c)
Data type
d)
a type of memory
4.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
5.
A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly
a)
True
b)
False
6.
What will be the output?
name = 'Dave'
print (name)
a)
Dave
b)
'Dave'
c)
name
d)
(name)
7.
When you have an error in your code what is the term to summarise finding and fixing that error?
a)
Error checking
b)
Debugging
c)
Syntax finder
d)
Error finder
8.
What would print (10 + 16) produce?
a)
20
b)
22
c)
24
d)
26
9.

Which of these would work as a piece of code?

Use the Cheat Sheet to help you.

a)
IF answer == "Yes":
b)
if answer == "Yes"
c)
if answer == "Yes":
d)
if answer = "yes":
10.
What is the answer to print (12/6)?
a)
1
b)
2
c)
6
d)
10
11.
How do you add a comment in python 
a)
!
b)
"
c)
/
d)
#
12.
What does the following code do?
name = input("what is your name")  
a)
says hello 
b)
asks for the users DOB
c)
Asks for the users name and stores it in a variable 
d)
Checks information 
13.
What does the following code do? 
Score = Score + 1 
a)
Nothing 
b)
prints score 
c)
Displays 1
d)
adds 1 onto the score 
14.
What does the following code do? 
Score = Score + 1 
a)
Nothing 
b)
prints score 
c)
Displays 1
d)
adds 1 onto the score 
15.

10= 100
Which of the following is used in Python to calculate ten squared?

Use the Cheat Sheet to help you.

a)
10 ** 2
b)
10 * 2
c)
10 % 2
d)
10 ** 10
16.

In python the ' INTEGER data type' can be defined as...?

Use the Cheat Sheet to help you.

a)
holds alphanumeric data as text
b)
holds whole numbers
c)
holds numbers with a decimal point
d)
holds either ‘true’ or ‘false’
17.
What will the following lines of code print?
a)
A
b)
B C
c)
A C
d)
Nothing, it will return an error.
18.
A syntax errors means you have an error with your python program or a symbol/operator is incorrectly used
a)
True 
b)
False
19.
What function is used to let the user answer a question?
a)
Open
b)
Print
c)
Answer
d)
Input
20.
A ________ is a sequence of alphanumeric characters. 
a)
string
b)
floating point number
c)
boolean
d)
snake
21.
Repeating section of code to simplify a solution
a)
Code
b)
Loops
c)
Program
d)
Bugs
22.
To repeat until a particular condition is true use
a)
while loop
b)
for loop
c)
if loop
d)
indentation
23.
The character that must be at the end of the line for if, while, for etc.
a)
:
b)
;
c)
.
d)
,
24.
What is the output from this program?
a)
5
7
9
A python is a non-venomous snake
done
b)
A python is a non-venomous snake
A python is a non-venomous snake
A python is a non-venomous snake
done
c)
A python is a non-venomous snake
A python is a non-venomous snake
A python is a non-venomous snake 
A python is a non-venomous snake
done
d)
done
25.
How would  you print a text string?
a)
output "Hello!"
b)
print ("Hello!")
c)
print (Hello!)
d)
output (Hello!)
26.
If this code was run, what would be the result?
a)
Hello
Hello
b)
Hello
Hello
Hello
c)
What did the 3 headed policeman say?
d)
What did the 3 headed policeman say?
Hello
Hello
Hello