NEW
Font size
WorksheetsPython #1 Grade #7
Total questions: 16
Worksheet time: 8mins
In python the INTEGER data type can be defined as...?
holds numbers with a decimal point
holds alphanumeric data as text
holds whole numbers
holds either ‘true’ or ‘false’
In python the ' FLOAT data type' can be defined as...?
holds whole numbers
holds alphanumerical data
hold either true or false
holds a decimal point in a number
In python the ' STRING data type' can be defined as...?
holds either a true or false value
holds alphanumeric text
hold whole numbers
holds numbers with a decimal point
The statement input allows us to:
Input values to the code
Order the imported statements
Read what the user typed
Show there name
Which of the following code is a Python Comment?
" this is a comment "
{ this is a comment }
# this is a comment
( this is a comment )
What is a variable?
a type of memory
A memory location where you store values
a type of graphics
Data type
What is a string in Python?
hold whole numbers
something that ties words together
a long piece of woven material
text, or keyboard characters
What will the output be from the following Python code?
print (Hello world!)
Hello world!
Syntax Error
Hello world
print(Hello world!)
The correct syntax for converting the string x to uppercase is:
x.upper()
X.upper()
upper(x)
x.UPPER[ ]
In Python what is the addition sign?
=
+
/
-
My_name = "Awesome"
My_name in this string is...
prompt
my name
a variable
syntax
What symbol is used in python to assign values to a variable?
asterisk *
plus +
forward slash /
equals =
The correct syntax for converting the string myname to lowercase is :
myname_lower(12)
myNAME.lower[ ]
myname.lower( )
myname.upper( )
Let x= "Python", the output of print(x.upper()) is
"PYTHON"
_PYTHON
PYTHON
python
What will be the output?
name = "Dave"
print (name)
Dave
'Dave'
(name)
name
The correct way to write a variable in Python?
my_variable = 10
my variable = 10
my_variable is 10
my_variable: 10
