One liners aren't common practice in production. Hard to read, prone to bugs. You really don't need a for loop here as you mainly need to specify the larger of the two numbers (math is weird I know) and run the SUM for the numbers in the RANGE.
I have a question. I am new to coding and finding one part confusing. Why does we switch the a and the b in the second and third elif statments. I guess Im confused on why it matters if a is bigger than b or if b is bigger than a.
This comment is hidden because it contains spoiler information about the solution
range function fails if the second condition is lower than the first. For ex in the code, range(10, 5) , this wouldnt be able to create that range.
OP solved it, closing
One liners aren't common practice in production. Hard to read, prone to bugs. You really don't need a for loop here as you mainly need to specify the larger of the two numbers (math is weird I know) and run the SUM for the numbers in the RANGE.
I have a question. I am new to coding and finding one part confusing. Why does we switch the a and the b in the second and third elif statments. I guess Im confused on why it matters if a is bigger than b or if b is bigger than a.
let us just hope, that the earthquake will never strike with 4 waves :-)
You're strong man)
Add more spaces. But it's good. Nice sol man
good boy
It worls for me as well, same code from a beginner :)
I have a similar code. I took me forever lol
This is most useful for beginner
cleanest solution
gut
Loading more items...