- Structured Programming
- Selection Control Structures
- Code Blocks
- Condition Examples: Temperature Conversion Pseudocode
- Condition Examples: Python Code
- Structured Quiz 5 questions
- If and If-else Statement
- If and If-else Quiz 5 questions
- Chained Decisions
- Chained Decisions Quiz 5 questions
- Nested Decision
- Nested Decision Quiz 5 questions
- Conditional Expressions
- Conditional Expressions Quiz 5 questions
Quiz Question 1 of 5
Consider the following scenario: A program reads a user's age and prints "Senior discount available" if the age is 65 or older. If the condition is incorrectly specified as if age > 65:
, what is the practical consequence?
Choose the correct answer below:
-
A
The program will only offer discounts to individuals older than 65, excluding those who are exactly 65 years old.
-
B
The program will raise a TypeError if the age is exactly 65.
-
C
The program will execute without any issue, as Python handles age as an integer.
-
D
The program will offer discounts to all users, regardless of their age.