Font size
WorksheetsByteBattle 2.0(3)
Total questions: 30
Worksheet time: 20mins
Hey Aashi, Aditi, and Ria! Can you guess which function is the superstar for displaying output in Python?
display
output
show
To take user input in Python, we use the ________ function.
Hey Avni, can you help Tisha figure out the correct syntax for declaring a variable in Python? Which one do you think it is?
variable_name = value
variable_name -> value
variable_name : value
value = variable_name
Which of the following is the correct way to create a list in Python?
list = []
list = ()
list = {}
list = <>
What symbol is used for comments in Python?
//
#
/*
Hey there, coding wizards! If Advait and Shreya were to divide 5 by 2 in Python, what would their magical result be?
3
1.5
2.5
2
____________ operator is used for exponentiation in Python.
Which of the following bitwise operators is used to perform a bitwise AND operation in Python?
&
|
^
~
What will be the result of the expression: 5 & 3 in Python?
1
2
3
0
Which operator is used for bitwise NOT in Python?
!
~
^
&
Variable names in Python can start with a number.
What will be the output of the following code: print(5++3) in Python?
8
5
Syntax Error
None
In Python, what does the ++ operator do?
Increments the value by 1
Decrements the value by 1
Has no effect
Causes a syntax error
Which of the following statements is true regarding the ++ operator in Python?
It is a valid operator
It can be used to increment variables
It does not exist in Python
It is used for string concatenation
What will be the output of the following code: print(True and False)?
True
False
None
Syntax Error
In Python, which operator is used to negate a boolean value?
!
~
NOT
^
What will be the output of the following code: print(True or False)?
What will be the output of the following code: print(!False)?
What will be the output of the following code: print((True or False) and False)?
What will be the output of the following code: print((True and False) or True)?
What will be the output of the following code?
import math
print(math.ceil(4.3)))
What is the output of the following code?
x = 5
y = "5"
print(x + y)
What is the output of the following code?
x = "7"
y = "5"
print(x + y)
Which of the following is used to define a block of code (body of loop, function, etc.) in Python?
What will be the output of the following code?
x = 5
y = 10
print(x == y)
5==10
What is the output of this code?
x = "Hello"
y = "World"
print(x + y)
What is the result of this operation?
3 * "abc"
Which of the following will not raise a syntax error in Python?
Print("Hello, World!")
print("Hello, World!");
printf("Hello, World!")
print("Hello, World!")
What will be the output of the following code?
x = 5
y = "10"
print(x + int(y))
Which of the following is not a valid Python keyword?
if
else
