WorksheetsMore About Python & AI
Total questions: 45
Worksheet time: 4hrs 45mins
The program above
prints all the odd numbers between 1 and 20
prints all even numbers between 1 and 20
print all the odd numbers between 1 and 21
prints all the even numbers between 1 and 21
for i in 100 :
print ( i )
Syntax error
prints numbers 0 to 100
prints numbers 1 to 100
prints numbers 0 to 99
prints numbers 1 to 99
In programming, what is iteration?
The repetition of steps within a program
The order in which instructions are carried out
A decision point in a program
Testing a program to make sure it works
FOR loops are
loops which run an unknown number of times
loops which run for a specific number of times
the same as if statements
not part of programming
WHILE loops are
loops which run an unknown number of times
loops which run for a specific number of times
the same as if statements
not part of programming
Which kind of loop would be used?
I need a program that will keep letting me add a monthly payment for 12 months.
FOR Loop
WHILE Loop
Which kind of loop would be used?
I need a guessing game program that will let me keep guessing until I get the right answer.
FOR Loop
WHILE Loop
Which kind of loop would be used?
I need a revision program that will run through revision questions 4 times.
FOR Loop
WHILE Loop
Which kind of loop would be used?
I need a program that will keep letting me add money to a piggy bank until I get to £100.
FOR Loop
WHILE Loop
What does this program print
2 + 2 = 4
4 + 4 = 8
8 + 8 = 16
16 + 16 = 32
32 + 32 = 64
2 + 2 = 4
2 + 2 = 4
2 + 2 = 4
2 + 2 = 4
2 + 2 = 4
2 + 2 = 4
2 + 4 = 6
2 + 6 = 8
2 + 8 = 10
2 + 10 = 12
2 + 2 = 4
2 + 2 = 4
2 + 2 = 4
2 + 2 = 4
2 + 2 = 4
2 + 4 = 6
2 + 6 = 8
2 + 8 = 10
What will this code do?
Print Numbers 1-11
Print Numbers 1-10
Print Numbers 2-10
Print Error
what will this display?
0,1,2,3,4,5
0,1,2,3,4
1,2,3,4,5
Error
2
11
2
21
2
3
11
2
3
21
What is the output of range(1,10)
0123456789
123456789
1 to 10
012345
In a Python program, what would be the increment value for the looping variable in the FOR LOOP code?
15
7
10
1
Which of these will allow me to count from 0-20 in steps of 5?
for x in range(0,20):
print(x)
while x = (0,20,5):
print(x)
for x in range(0,21,5):
print(x)
for x in range(0,21,5):
print(y)
What is output of given python code ?
for i in range(2,10,2):
print(i)
Error
2 4 6 8
2 4 6 8 10
2 3 4 5 6 7 8 9 10
What is output of given python code ?
Error
2 5 8
2 5 8 10
2 5 8 10 Manju
What will be the output to the console for the code shown?
0
2
6
2
4
6
8
2
3
4
5
2
4
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 does the following program display?
1,2,3,4
1,2,3,4,5
counter,counter,counter,counter,counter
0,1,2,3,4,5
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 does the following program display?
1,2,3,4
1,2,3,4,5
counter,counter,counter,counter,counter
0,1,2,3,4,5
When do you know when you come to the end of the loop?
Its states End loop
The command End is given
The indentation stops
if you wished a loop to repeat 3 times what should you use?
for counter in range(0,5):
for counter in range(1,3):
for counter in range(0,3):
what is the name of the variable used in the following code?
counter
for
#
what is the name of the variable used in the following code?
counter
for
#
What value will "num" start with when the code is run?
0
1
10
2
Whatever is input from the user
Correct this line of code
input=num
(a)
Below are some example of using AI in gaming world, except?
Chess
Rock-Paper-Scissors
Mystery Animal
Emoji Scavenger Hunt
None of the above
A step in problem solving by AI where the best solution is chosen from the identified solutions to achieve the target.
defining the problem
analysing the problem
identification of solutions
choosing a solution
implementation
A step in problem solving by AI where the problem analysis and its requirements must be done to have an impact on the resulting solution.
defining the problem
analysing the problem
identification of solutions
choosing a solution
implementation
A step in problem solving by AI where the problem must be defined explicitly and precisely.
defining the problem
analysing the problem
identification of solutions
choosing a solution
implementation
A step in problem solving by AI where it is the last step of them all.
defining the problem
analysing the problem
identification of solutions
choosing a solution
implementation
A step in problem solving by AI where it generates reasonable amount of solution to the given problem falling in a particular range.
defining the problem
analysing the problem
identification of solutions
choosing a solution
implementation
A tool used by AI inspired by the human nervous sytem.
Logic
Classifiers
Probabilistic
Artificial Neural Network
A tool used for AI where proportional logic which involves truth functions such as 'or' 'and' 'not' is called?
Search and Optimization
Classifiers and Statistical Learning Methods
Artificial Neural Network
Logic
(a) are require educational qualification like engineering to make expert systems that comes under functional expert systems.
_ are tasks you do on a routine basis.
(a)
Which are not the advantages of AI?
Enhance creative assignments
Substitution for human in dangerous jobs and environments
Take break for coffee
Searching for better solution
