Font size
WorksheetsPP Quiz- 4CSM B2
Total questions: 11
Worksheet time: 11mins
Enter your ROLL NO.
print(3+3==6 or 1+5==6)
what is the output?
true
false
both
none of the above
What is the output of the following?print(not(2+2==6) and 2+3==5)
none of them
true and true
False
True
How can we increment a integer (e.g num = 5) variable by 1?
num=+1
num+=1
num++
More than one choice is correct.
Which of the following is TRUE?
The equal to operator (=) is used for comparison.
None of these.
The equal to operator (==) is used for assignment.
The equal to operator (==) is used for assignment.
Which of the following is the correct syntax to check if the variable x is equal to 5?
if (x=5)
if (x==5)
if (x=5):
if (x==5):
What is the output of the following?
print (1/2 + 1.0/2)
2.5
0.5
1.5
None of these
Which of the following is FALSE about variables?
Variables must begin with a letter.
Variables can be one of the reserved Python keywords like def, elif etc.
Variables can contain letters, numbers, and underscores.
All of these are TRUE.
What is the output of the following?
x=5
if (x==5):
print("x==5")
else:
print ("x=5")
x=5 x==5
x=5
x==5
The code has syntax errors.
Next
How can we convert the following variable to a string?
num = 5
str(num)
num + ""
All of these.
string(num)
Next
What is the output of the following code?
print (str(bool(1) + float(10)/float(2)))
"2.5"
1.5
6.0
"6.0"
Next
