Font size
WorksheetsPython - Basic Data, Structure, and Concepts
Total questions: 30
Worksheet time: 16mins
Which of these describe Python?
A Complied Programming Language
An Interpreted Coding Language
A useless coding language
A Chinese coding language
A logical plan of our code before we write it is called...?
Pseudo Code
Code Topology
Illogical Code
Code Mapping
An Error in code is typically known as a... ?
bug
road-block
fault
insect
Fixing problems in code is known as...?
Debugging
Error Hunting
Syntax-Sniping
A waste of time
A line of code that begins with '#' will be skipped over by the interpreter and is mainly used to keep notes. This is called a...?
Comment
Annoyance
Marker
Flag
Choose the code that will output an integer
20 / 5
2 * 6
19 < 21
print("123")
Choose the code that will output a float
20 / 5
2 * 6
19 < 21
print("123")
Choose the code that will output a string
20 / 5
2 * 6
19 < 21
print("123")
Choose the code that will output a boolean
20 / 5
2 * 6
19 < 21
print("123")
Which operator will make this statement True?
a = 15
b = 2
a _ b == 30
*
+
-
**
Which lines will break the code? (There's more than one... look at the values AND the varable names and find problems)
text = "Blah"
2_text = "Blah Blah"
text_3 = "Blah Blah Blah
text-4 = "Blah Blah Blah Blah"
Line 1
Line 2
Line 3
Line 4
Create a variable called my_bool and assign it this boolean statement: 19 is greater than or equal to 15
(a)
how would we most efficiently check for the length of this string?:
text = "How long is this String?"
len(text)
count(text)
Count each character manually
How_long_is_this_string(text)
Which letter will be returned with the last command in this code?:
text = "White Walkers"
text[0]
'W'
'w'
's'
' '
Which letter will be returned with the last command in this code?:
text = "White Walkers"
text[-1]
's'
'W'
'w'
' '
What would be the output of this code?:
11 % 3
2
3.6666
4
1
What would be the output of this expression?
a = "A Lannister always pays his debts."
"ster al" in a
True
False
type( )
print( )
input( )
len( )
These are examples of...?
functions
methods
strings
types
my_string = "Night gathers, and now my watch begins"
my_string[: : 2]
This command will grab...
Every 2nd character
all characters from beginning until index 2
All characters from index 2
All characters
What will be the output of this code?
quote = "And now his watch is ended"
"and" in quote
True
False
Look at these types of Data:
"Hello"
5632
37.11
19 < 20
What is the correct order of their data types from top to bottom?
String
Integer
Float
Boolean
Boolean
Float
Integer
String
String
Float
Integer
Boolean
String
Boolean
Float
Integer
We have a variable called:
my_variable
but we can't remember what type of data it contains.
How would we check what type of data is contained inside?
(Hint: use a function)
(a)
What will be the output of this expression?
6 == 6 or 10 < 2
True
False
Error
8
What would we call the second line of this code?
my_string = "for altering"
my_string.upper()
A method
An expression
A bug
A trial
Look at this code:
sword_1 = "Ice"
sword_2 = "Oathkeeper"
print(f"{sword_1} is a valerian steel sword that gets melted down and used to make {sword_2}")
This is an example of string...?
Formatting
Concatenation
Indexing
Slicing
What will be the output of this code?
a = "Check me"
type(a)
str
'Check me'
An Error
'check me'
What will be the output of this code?
x = 256
len(x)
int
3
An error
256
What will be the output of this code?
a = "Blardie Blah Blah"
b = 256.2031233331233
c = 23 > 21 and 10 != 10
type(c)
bool
True
False
float
Q.
What will be the output of this code?
a = "Blardie Blah Blah"
b = 256.2031233331233
c = 23 > 21 and 10 != 10
type(b)
bool
str
float
True
Which Data type is this?: "We do not sow"
String
Integer
Boolean
Float
