Font size
WorksheetsPython-Basic
Total questions: 15
Worksheet time: 8mins
What would be printed by the command
print('12-5')
12-5
'12-5'
7
'7'
Which of the operators do we use if we want at least one condition to be true?
and
or
else
not
print(Hello world!)
What will be the output of the following statement?
type('5')
str
int
float
Boolean
Which one is NOT a legal variable name?
my_var
myvar
_myvar
my-var
What is the correct file extension for Python files?
.py
.pt
.pyt
.pyth
How do you create a variable with the numeric value 5?
Both are correct
x=5
x=int(5)
Which operator can be used to compare two values?
=
<>
><
==
Which of the following is a data type in Python? Select multiple answers.
int
words
string
decimals
a = "Good Morning!"
print(len(a))
13
12
11
14
a = "Hello, World!"
print(a.lower())
hello, World!
HELLO, WORLD!
hello, world!
Error
x = 23
y = 3
print(x // y)
7
7.6666
7.7
Error
What is the output of the code shown in the image?
2
3
'2'
'3'
What is the output of the code shown in the image?
#
#
#
#
####
#
##
###
####
#
##
###
####
#####
How difficult was the quiz?
Easy
Medium
Hard
Extremely Difficult
