Python Forum
Having problems using 'or' in a 'if' statement?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Having problems using 'or' in a 'if' statement?
#1
number1 = 5
number2 = 10

if number1 or number2 == 6:
    print("Successful !")
else:
    print("Failed !")
My problem is that the code isn't working as ı want.It writes "Successful" on the screen.But it shouldn't.Because the each side of the or isn't 6. So it's false.It should write "Failed !".

Help Me Plzzz ... Huh Huh Huh
Reply


Messages In This Thread
Having problems using 'or' in a 'if' statement? - by umut3806 - Jul-21-2019, 10:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problems with if / else statement droid206 6 2,738 Apr-19-2020, 08:06 AM
Last Post: astral_travel
  problems with the If statement or is it the variables being used NickIgoe 2 2,131 Mar-22-2019, 06:34 AM
Last Post: NickIgoe

Forum Jump:

User Panel Messages

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