Question: I have a problem with my Python code. I am trying to display the ordinal number of the users input. So if I typed 32 it would display 32nd, or if I typed 576 it would display 576th. The only thing that doesn't work is 93, it displays 93th. Every other number works and I am not sure why. Here is my code:

```
num = input ('Enter a number: ')
end = ''
if num[len(num) - 2] != '1' or len(num) == 1:
  if num.endswith('1'):
    end = 'st'
  elif num.endswith('2'):
    end = 'nd'
  elif num == '3':
    end = 'rd'
  else:
    end = 'th'
else:
  end = 'th'
ornum = num + end
print (ornum)

```

Answer: 
You use `endswith()` at 2 places, instead of 3:

```
if num.endswith('1'):
    end = 'st'
elif num.endswith('2'):
    end = 'nd'
#elif num == '3':  WRONG
elif num.endswith('3'):
    end = 'rd'

```

In your code, it will test 'if num is equal to 3' instead of 'if num ends with 3'.
For some reason you forgot to check `endswith()` when it comes to `3`:

```
elif num.endswith('3'):
    end = 'rd'

```

On a side note, you can improve your code by reading [this question](https://codereview.stackexchange.com/questions/41298/producing-ordinal-numbers) on SE Code Review, which included this awesome version:

```
SUFFIXES = {1: 'st', 2: 'nd', 3: 'rd'}
def ordinal(num):
    if 10 <= num % 100 <= 20:
        suffix = 'th'
    else:
        suffix = SUFFIXES.get(num % 10, 'th')
    return str(num) + suffix

```