How fast can you find the bug?! #computerscience #coding #softwarengineer #programming

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

If x=y, the output will always be z.
In the example 4, 4, 1 the "1" will be printed.

MrNemedi
Автор

Not a bug but you shouldve asked if this code does what its supposed to do

ns
Автор

Saw it almost instantly...if anything is = to another it will always return z.

RD_RT
Автор

The code works, but if your goal is to print the largest number then you're going to have a bad time.

potoplayer
Автор

There is no bug in this specific example. It would fail when x and y are equal. Nobody would find a max num this way though lol.

Argschnarbler
Автор

Output is 1 cause it's in the first 2 conditions it's false and there is a logical error u should add another condition for the Z as well

Bay-H-B
Автор

lets check the 1st else if statement is written elif

HililaryWinifred
Автор

The else part is the bug. It should include more cases to work efficiently.

AmbitiousAmbrish
Автор

Wow, a lot of people would actually fail this.
As of the time I commented, only around two people got it.

asagiai
Автор

def maxNum(x, y, z):
if x >= y and x >= z:
return x
elif y >= x and y >= z:
return y
return z

1. >= instead >
2. else is unnecessary ;)

sus-slowedukrainiansongs
Автор

There's no bugs in this code it's just poorly designed. It doesn't account for if any of thr values are equal to each other. This has logic errors but if you run the code it will be fine. Plus checking for the biggest number shouldn't really be done this way since you're passing in more than two numbers.

SilentDeterrent
Автор

Camel Case in python. Major cause of bugs

giorgioripani
Автор

its will be 1 as output cuz the same between x and y as 4, 4, 1 => x, y, z

davejackson
Автор

the bug is that u are printing the maxNUM thing

umangagyawali-he
Автор

The code will not work because there are no x, y or z values…

NotAnNPC
Автор

x is y. So it will always be z for obvious reasons.

RailFroggit
Автор

There’s no bugs in the code, it would execute perfectly fine

thecolorblue
welcome to shbcf.ru