Python From Beginner to Advanced
0% completed
Previous
Next
Course
Discussions
Quiz
What is the correct way to define a variable 'a' with the value '100' in Python?
A
var a = 100
B
a = 100
C
int a = 100
D
a := 100
Reset Quiz
Check Answer
Which data type would be used to store a value that is either 'True' or 'False' in Python?
A
string
B
boolean
C
int
D
bool
Reset Quiz
Check Answer
How would you convert the string "123" to an integer?
A
int("123")
B
str(123)
C
"123".to_int()
D
convert("123", int)
Reset Quiz
Check Answer
What is the result of '8 % 3'?
A
2
B
2.67
C
3
D
0
Reset Quiz
Check Answer
Which operator is used for exponentiation in Python?
A
**
B
^
C
D
exp()
Reset Quiz
Check Answer
Which of the following is a valid Python variable name?
Choose all correct options
my_var
2nd_var
var_name
_var
Reset Quiz
Check Answer
What does the expression not False evaluate to?
A
True
B
False
C
0
D
1
Reset Quiz
Check Answer
What will be the output of the following code snippet?
x = "Python" y = "Rocks" print(x + y)
A
PythonRocks
B
Python Rocks
C
TypeError
D
SyntaxError
Reset Quiz
Check Answer
.....
.....
.....
Like the course? Get enrolled and start learning!
Enroll
Previous
Next