Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[easy] If, and.
#1
Hello everyone,

I'm a new user of Python and I'm learning from the beginning.
I'm trying to make a code that ask for three numbers and show the bigger.
I've started with "if" and "and" to test, but it doesn't work well...follow the code:

n1=int(input("N1: "))
n2=int(input("N2: "))
n3=int(input("N3: "))
if n1 > (n2 and n3):
  print(n1)
In this case I wrote just for the variable n1 (only for test), but when I put N1=5; N2=10 and N3=1, for example, it return "5", but in my opinion the code shouldn't return anything because 5 isn't bigger than 10.

Anybody could help me?

Thanks in advance!
Henry
Reply


Messages In This Thread
[easy] If, and. - by Henry26 - Jul-17-2018, 02:07 PM
RE: [easy] If, and. - by mlieqo - Jul-17-2018, 02:19 PM
RE: [easy] If, and. - by Henry26 - Jul-17-2018, 06:34 PM
RE: [easy] If, and. - by woooee - Jul-17-2018, 06:43 PM
RE: [easy] If, and. - by Henry26 - Jul-18-2018, 06:36 PM
RE: [easy] If, and. - by nilamo - Jul-18-2018, 07:05 PM

Forum Jump:

User Panel Messages

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