Font size
WorksheetsProgramming revision
Total questions: 16
Worksheet time: 13mins
Complete this sentence: A ………………… data type represents only two values.
Float
String
Character
Boolean
Which of the following data types is used to store several characters?
Character
String
Boolen
Integer
Which of the following is NOT an integer?
3
-3.2
-3
0
What symbol is used to assign values in Python?
==
!=
=
←
Which of the following is FALSE?
Variable declaration is done at the start of the program
Variable declaration is important to allocate required memory space
Not initialising a variable results in an error-free output
All of the above
Which of the following represents labels that represent values in computer and that can be changed during program execution?
Constant
Variable
Data type
DIV
Which of the following programming construct denotes execution of statements or functions one after another?
Sequence
Selection
Iteration
Order
What programming construct does this diagram represents?
Sequence
Selection
Iteration
Nothing
Which of the following arithmetic operator in Python is used to find remainder of a division operation?
DIV
//
DON
MOD(%)
Complete this sentence: ……………………… is used to execute a particular set of statements repeatedly until a condition is satisfied.
Sequence
Selection
Iteration
All of them or above
Which of the following structure is used to iterate a set of statements by counting the number of times it needs to be executed?
For structure
Do…. While
Repeat… Until
None of above
Which of the following statements is used to typecast a variable that holds string data type?
Variable_name=input(“Enter string value: ”)
Variable_name=Str(input(“Enter string value: ”))
Variable_name=String(input(“Enter string value: ”))
Variable_name=Chr(input(“Enter string value: ”))
What is the output of this code in Python?
num=float(45)
print("num= ",num)
num=45.00
num=45.0
num=45
num=45.000
What symbol is used to add comments in Python?
!
%
#
~
• Input 2 numbers from the user
• Add both inputs together
• Output the result
• Input a number from the user
• Double the number input and print the result
• Repeat bullets 1 and 2 until the user enters a number less than 0.
