WorksheetsReview Final Python 1st semester
Total questions: 55
Worksheet time: 1hrs 23mins
How do you define(assign) variables?
var="String"
func==Hello
var : 123
word= Hello
Which one does take you to next line?
\t
\n
/n
\\
What is the word (command) used to display numbers and text on the screen?
Input
Output
Command
What symbol is used in python to assign values to a variable?
:
*
=
==
What is the end after if statements?
if
Elif
Else
While
A line of text that Python won't try to run as code
Integer
Comment
Strings
Input
A data type than can have one of two values: True or False
Boolean
Basic Calculation
For
While
Data type for a whole number
Float
Boolean
Integer
String
The Boolean operator that returns true if EITHER of its operands are true
and
or
not
equal
// means:
two times division
integer division
exact division with floating number
Put a slash
What does symbol % do?
Integer exact division
Percentage
Division
Remainder
In the following code, what is happening?
foo = "bar"
A variable named foo is being created, with a value of "bar"
A variable named bar is being created, with a value of "foo"
In the following code, what type of variable is being created?
foo = "bar"
Integer
Float
String
In the following code, what type of variable is being created?
foo = 3.5
Integer
Float
String
If foo is equal to 3, what is the value of foo after this operation?
foo /= 3
3
2
1
What do we use variables for?
To store data
Print data
Produce functions
An operator is a symbol of the programming language, which is able to operate on the values.
True
False
What will be the output of :
print(2 ** 3)
8
4
6
Syntax Error
An * (asterisk) sign is exponentiation (power) operator.
True
False
What will be the output of this code:
print(6. / 3.)
2.0
2
63
3
What will be the output of this code:
print(6 // 3)
2.0
2
63
3
What will be the output of this code:
print(-6 // 4)
2.0
-2
4
6
The graphical representation in Python of the operator :Remaider(modulo) is :
%
$
//
**
What will be the output of this code:
print(14 % 4)
14
2
4
3
What does every Python variable have?
A name and a value.
Numbers only,
Description of the itme only.
An operator.
The name of the variable must begin with a letter
True
False
In a Variable the underscore character is considered as letter.
True
False
What can you put inside a variable?
Anything
Only numbers
Strings
Operators
What will be the output of this code:
var = 1
print(var)
14
1
4
3
What will be the output of this code:
var = 5
print(Var)
5
NameError
Var
print(Var)
What will be the output of this code:
var = "3.8.5"
print("Python version: " + var)
Python version: 3.8.5
NameError
Var
3.8.5
integers are...
algebra
your age
whole numbers including negatives
imaginary
Variables may hold...
Strings
Integers
Floats
Booleans
All of the above
+, -, /, * ... these are examples of:
Arithmetic operators
Comparison operators
==, !=, <, > ... these are examples of:
Arithmetic operators
Comparison operators
Which of the following operators requires two conditions to be true?
AND
OR
NOT
>
Which of the following operators requires one condition to be true?
AND
OR
NOT
>
Which of the following operators requires a condition to be false?
AND
OR
NOT
>
Which statement will require girls with brown hair to stand up?
Girl OR Brown Hair
NOT Girl AND Brown Hair
Brown Hair AND Girl
What is the output of this snippet?
True
False
nothing is printed out
i don't know
What will be the output of the following
0
2
syntax error
32
What will be the output of the following
12
15
syntax error
27
What will be the output of the following
31
240
16
Error
What will be the output of the following
31
8
16
Error
What will be the output of the following
31
128
16
Error
What is the output?
more than 7
more than 23
spam
7
What is the output?
True
False
condition1
condition2
What is the output?
next
stop
next
stop
syntax error - program doesn't work
What is the output?
3
3
7
3
5
7
7
The % symbol in Python is used to.
Get the reminder of a division problem.
Divide the number
Calculate the percentage
Print the output
