Python Forum
Learning about if statements
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Learning about if statements
#2
I would argue for the top version, from the point of view of maintainability and expandability. What happens if another fruit is introduced, apple? Add a couple lines to the first one and you are fine. But, how do you fix the second code snippet to handle apples? And then they add coconuts. And they migrate.
Reply


Messages In This Thread
Learning about if statements - by kam_uk - Nov-15-2020, 04:59 PM
RE: Learning about if statements - by jefsummers - Nov-15-2020, 11:15 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020