Lecture
Coding Quiz
Create a function that takes two numbers, num1 and num2, and returns True if num1 is greater than num2; otherwise, it returns
False.
Function Parameters
def solution(num1, num2): return # Write your code here
-
Returns
Trueif the left number (num1) is greater than the right number (num2). -
Returns
Falseif the left number (num1) is less than or equal to the right number (num2).
Constraints
-
The numbers provided are integers.
-
The input numbers are non-negative.
Input/Output Example
Input: solution(4, 2)
Output: True
Lessons in this chapter Β· Boolean Data Type and Logical Operators
- 1. Boolean Data Type for Determining True or False
- 2. Generating Boolean Values with Comparison Operators
- 3. Usage of and, or, not Logical Operators
- 4. Multiple-choice quiz
- 5. Checking if Two Objects Are Identical with the is Operator
- 6. The not Operator Returning the Opposite
- 7. Combining Boolean Values with and, or Operators
- 8. Coding Quiz - Compare Values
- 9. Multiple-choice quiz
- 10. Fill-in-the-blank quiz
Lecture
AI Tutor
Design
Upload
Notes
Favorites
Help