WorksheetsPython Fundamentals 1
Total questions: 22
Worksheet time: 13mins
What symbols are Logical Operators?
AND, OR, NOT
=, +=, -=
>=,==,<=,!=
All the rules of Variable names are true EXCEPT:
Cannot Begin with Capital letters
Can Begin with a Letter
Cannot have a spaces in between
All of the Above
Which if statements are incorrect?
if a==a:
if a = b:
if a not in b
if input() = b:
else a != b:
A function is used to store lines of code to be called later.
True
False
A student tried to run a an if statement that was empty. The expected result was:
The script ran without error
The script ran but didn't print anything
The script did not run
The script was ignored
<=,==,>,< are known as:
Arithmetic Operators
Assignment Operators
Comparison Operators
Logical Operators
A function can be executed if:
it is defined
it is called at another part of the program
"name()" is the keyword of any function:
True
False
If an if statement's conditions are not met, it will:
What is the output of this Script?
'They are not the same'
a = b
Syntax error
elif code block is executed
None of the above
What does this button do in VsCode?
Opens the Terminal
Run and Debug a script
Cleans errors
Checks for viruses
What is this called?
Ribbon
Task Bar
Tabs
Window
A (a) is the joining of multiple strings.
What kind of software can be used to run and write a script?
Integrated Development Environment (IDE)
Compiler
Text editor
Python
" a = Int(input())" ensures that:
a is being assigned the value of a float input.
a is being assigned "int(input())"
a is being assigned the value of an input.
print("123"+123) outputs:
123 123
What is the purpose of '' ** '' in python?
Perform Multiplication
Perform Division
Creates a Comment
This is a collection of similar values.
Variable
Container
Object
All of the following is true about string formatting in python except:
String formatting in python is possible using the f operator
String formatting allows for expressions to be inserted into a string
All of the above
FOR and WHILE are examples of Loops
What is the output of this script?
H
E
L
L
O
What is a Variable?
A storage location in a computer program
A value in a line of code
A variable is a type of value
