NEW
Font size
WorksheetsPython Chapter 7
Total questions: 42
Worksheet time: 42mins
is integer a number
true
false
chose which is a floating point
14
15.5
What will be the output?
name = "Dave"
print (name)
Dave
'Dave'
name
(name)
What is the output from the following code?
print ("hello world")
The punctuation requirements for printing a string in Python are:
( ) , ! and " "
( ) and !
( ) and " "
" " and !
name=input("What is your name? ")
print("Your name is " , name)
What will be displayed if the user types in "Bob"?
Your name is name
name
Bob
Your name is Bob
What extension is used by python file?
What does the following code do? myAge = int (myAge)
Converts the var (variable) myAge to a string
Converts the var (variable) myAge to a integer
Converts the var (variable) myAge from a integer to a string
Converts the var (variable) myAge to if statement
What result will display in the shell if 15 and 20 is entered by the user?
"num1 + num2"
1520
35
What output will the console show, if 15 and 30 are entered by the user?
Syntax error
The sum of the two numbers - 45
The concatenation of the two numbers - 1530
Complier error
Python language was developed in what year?
1985
2001
1991
1820
Who developed Python Programming Language?
Wick van Rossum
Rasmus Lerdorf
Guido van Rossum
My dad
The output of the program
x = 4
x = "Sally"
print(x)
four
Saly
Sally
Code for
b is greater than a
a = 33
b = 200
if b > a:
print("b is greater than a")
a = 33
b = 200
if b < a:
print("b is greater than a")
a = 330
b = 200
if b > a:
print("b is greater than a")
Code for
257
Hello, World!
x = 257
y = "Hello, World!"
print(y)
print(x)
x = 257
y = "Hello, World!"
print(x)
print(y)
x = 257
y = Hello, World!
print x
print y
Code for
Five is greater than two!
if 5 > 2:
print("Five is greater than two!")
if 5 = 2:
print("Five is greater than two!")
if 5 > 2: Print("Five is greater than two!")
It displays an output
What does the = = symbol mean in Python?
Equal to or shows equality
Not Equal
Code that will be skipped
End of clause
Failure
In the provided code, what is the final value for alarm?
6
7
8
9
Which of the following is not a Relational Operator?
<=
==
=
!=
Which code means not equal to?
==
<=
>
!=
What is the output?
more than 7
more than 23
spam
7
This is a catch-all for every other situation besides the one where the condition is true.
then
do
else
if
What is output when the code runs?
A
B
C
D
What is output when the code runs?
End
Even
Larger Than 10
No output is produced
What is output when the code runs?
Hi!
Hi!
Have A Nice Day
Good Afternoon
Good Afternoon
Have A Nice Day
These operators are used with numeric values to perform common mathematical operations.
Python Assignment Operators
Python Arithmetic Operators
Python Comparison Operators
Python Logical Operators
Example of valid variable name
12Name
name$
total-mark
total_marks
Which one of these is floor division?
/
//
%
#
Which of the following operators is the correct option for power(ab)?
a ^ b
a**b
a^^b
a ^ * b
How handsome is Mr Aryo?
On a scale of one to handsome, Mr. Aryo is setting the scale ablaze with his sheer hotness!
If being handsome were an Olympic sport, Mr. Aryo would definitely win the gold medal – and probably break the scale in the process!
Forget about global warming; Mr. Aryo's hotness is the real cause of rising temperatures!
Move over, Greek gods! Mr. Aryo's level of handsomeness is what legends are made of!
