I know that there are many ways to to write a code and get the same result.
However I just want some clarification on the following-
I typed -
if days >= 7:
return 40 * days - 50
elif days >= 3:
return 40 * days - 20
I noticed that other beginners typed -
elif days >= 3 and <= 6
Now both codes work.
Seeing that we already added 7 days or more in the "if", do we have to add it to the elif? I thought that the "if" takes precedence (7 or more), then "elif"(3 or more, but obviously not more or equal to 7 because "if" would have executed that) and then else ( neither if or elif was true).
Seeing that both codes work, which is 'more' correct or proper or 'this is what is expected when you do python coding'?
Thanks, hope what I ask makes sense.