5 Questions
What is the purpose of the def keyword in Python?
To define a function
What is the result of the expression math.isclose(5.0, 5.01, abs_tol=0.1) in Python?
True
What is the output of the following code: if 'a' in 'abc': print('a is in abc')?
a is in abc
What is the purpose of the else clause in a Python if-else statement?
To execute code when the if condition is false
What is the output of the following code: for i in range(5): print(i) if i % 2 == 0?
0, 2, 4
Test your knowledge of Python fundamentals, including defining functions with 'def', using the math module, and controlling flow with if-else statements and loops.
Make Your Own Quizzes and Flashcards
Convert your notes into interactive study material.
Get started for free