BeginnersProblem - 1 year ago 83

Python Question

I have a function named orderInt passed three integers and returns true if the three int are in ascending order, otherwise false. Here's my code so far:

`def orderInt(a, b, c):`

print "Enter 3 integers: "

a = input()

b = input()

c = input()

How do I compare the variables?

Answer Source

First of all, your indentation is wrong.

```
def orderInt():
print "Enter 3 integers: "
a = input()
b = input()
c = input()
if a<b<c:
return True
else:
return False
print orderInt()
```

Second, your function is taking three arguments and also taking inputs. The arguments passed will be overwritten by your `input`

s.

```
def orderInt():
print "Enter 3 integers: "
if a<b<c:
return True
else:
return False
a = input()
b = input()
c = input()
print orderInt(a,b,c)
```

Hope this helps.