You're developing an application where user input determines what discount they receive. Which structure would be most suitable for this kind of decision-making?

  • for loop
  • if-elif-else chain
  • nested if statements
  • switch-case statement
For this type of decision-making based on user input, an 'if-elif-else' chain is the most suitable structure. It allows you to check multiple conditions in sequence and execute the corresponding block of code when a condition is met.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *