0

# why is 7 incorrect?

in this code num=7 so if num==7 why would the answer 7 not also be correct? 7 is = to 7. 7 is also greater than 3. so it would seem that he answer could be 3 or 7

11 ответов

+ 2

num=7
if num>3:
print("3")
if num<5:
print("5")
if num ==7:
print("7")
#Outputs "3\n7", seems to like an incorrect answer.

+ 1

ok i though so too. nice to know im not crazy.

+ 1

You can report it for having an incorrect answer if you want to.

+ 1

Click challenge -> view correct answers -> top right

+ 1

got it thanks

0

Rahsaan Johnson
can you, please post the whole code so that we may be able to help?

0

what is the output of this code?
num=7
if num>3
print("3")
if num<5
print("5")
if num ==7
print("7")
the answers is 3 but couldn't it also be 7

0

Timon. I don't understand why the answer could not be 7 as 7 is equal to 7. its also true that 7 is greater than 3 both would be true.

0

Yes, it actually printed both. The answer in the challenge seems to be wrong.

0

how?

0

Entiendo que 7 es mayor que 3 debería imprimir 3 pero tmbn 7 es igual a 7 y marca error