NEW
Font size
WorksheetsPYTHON print,input,turtle test
Total questions: 76
Worksheet time: 38mins
Kite
Triangle
Square
Rectangle
The number of lines drawn in each case, assuming that the turtle module has been
10,9
9,10
9,9
10,10
Rectangle
Trapezium
Triangle
Square
Error
1 square
2 squares, at a separation of 100 units, joined by a straight line
2 squares, at a separation of 100 units, without a line joining them
a) Trapezium
Parallelepiped
Tetrahedron
Star
What is a programming language?
Written English
An artificial language used to program a computer
A language used in pseudocode
Machine code
What does the print command do?
Outputs a hard copy of a program to a printer
Outputs a message on screen
Print a hard copy of a flow chart to a printer
Prints out the the commands line by line on the screen
How do we get user input from the keyboard?
input = (What is your name?)
input = What is your name?
output = ("What is your name?")
name=input("What is your name? ")
What will be the output?
name = "Dave"
print (name)
Dave
'Dave'
name
(name)
What is the term for an error that a programmer makes in their code so the program won't run?
Program error
Syntax error
Code error
Logic error
Which of the following variable names is NOT allowed to be used?
first_name
name1
name#1
lastName
Where's the error here?
Bracket
Input type
Comma
Variable
A user inputs 6. What will be the error?
Variable is wrong
Input type is wrong
Brackets are wrong
Where's the error here?
Variable
Bracket
Syntax/word is missing
Wrong input
Where's the error here?
Bracket
Variable
Input type
Missing syntax/word
What would be the answer here
14.56
There would be an error
8.56
A user inputs 2, then 5. What would be the output here?
55
10
There would be an error
A user enter 5, then 7. What would be the output here?
35
77
55
There would be an error
A user enter a 5, then 7. What would be the output?
75
57
35
There would be an error
Print statement
Outputs a message on the screen
Gets data from the user
A decision
A loop controlled by a decision
Input statement
Outputs a message on the screen
Gets data from the user
A decision
A loop controlled by a decision
While statement
Outputs a message on the screen
Gets data from the user
A decision
A loop controlled by a decision
print("Hello world!")
print("Hello world!\nHello world!")
Hello world!
Which statement prints I am 10 years old?
pint("I am 10 years old.")
print('I am 10 years old.)
print('')I am 10 years old.
print("I am 10 years old.")
What is the Python built-in function used to display numbers and text on the screen?
input
output
command
Which is the Python logo?
What is a input?
A function that allows us to ask the user to enter some data.
To plug in something.
Data displayed on a screen.
A function
x = 5
y = 6
print(x*y)
The code above displays the following:
11
x*y
Syntax Error
30
Operators used in python:
divide, multiply, add, subtract
/, *, +, -
div, mul, +, -
\, x, +, -
~, *, +, -
4
3
2
1
3
2
1
0
4
3
2
1
3
2
1
0
4
3
2
1
3
2
1
0
8
6
4
2
Hello world!
Hello world!
Hello world!
Hello world!
Hello world!
......(repeated continuously)
False
Hello world!
Hello world!
Hello world!
Hello world!
Hello world!
(repeated continuously)
In Python, print () by default adds which of the following as an end line argument?
\t
\n
\s
\r
What does IDE stand for?
Internet Data Evaluation
Integrated Drive Electronics
Integrated Development Enterprises
Integrated Development Environment
Identify which of the following is not a valid variable name?
X005 =10
A.2 = 10
N_s = 10
r10 = 10
How many operands are there in the following arithmetic expression?
6 * 35 + 8 – (25 / 5)
4
3
5
8
Which of the following command is used to print the output 01-Jan-2020 ?
print('01','Jan', sep=' ', end='-2020')
print('01','Jan', sep='-', end='-2020')
print('01','Jan', sep='-', end='2020')
print('01','Jan','2020', sep='-', end='-2020\n')
What is the correct file extension for Python files?
.pyt
.pyth
.pt
.py
How do you insert COMMENTS in Python code?
/*This is a comment*/
#This is a comment
//This is a comment
Any of the Above
The activity or job of writing computer programs.
Syntax
Programming
Compiler
holds whole numbers
holds a decimal point in a number
