Python From Beginner to Advanced

0% completed

Previous
Next
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
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
How would you convert the string "123" to an integer?
A
int("123")
B
str(123)
C
"123".to_int()
D
convert("123", int)
What is the result of '8 % 3'?
A
2
B
2.67
C
3
D
0
Which operator is used for exponentiation in Python?
A
**
B
^
C
  • D
    exp()
    Which of the following is a valid Python variable name?
    Choose all correct options
    my_var
    2nd_var
    var_name
    _var
    What does the expression not False evaluate to?
    A
    True
    B
    False
    C
    0
    D
    1
    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

    .....

    .....

    .....

    Like the course? Get enrolled and start learning!
    Previous
    Next