"Int" object not iterable for a leap year program
<p>I am making a program to calculate if the given input is a leap year or not. I am using Python 2.7 on Windows 10 with Anaconda Shell.
It's a silly program and I dont understand why I am getting this error. There are a couple of solutions to this particular program online but I want to make my version work. Please help!</p>

<p>I am getting the error message "TypeError: 'int' object is not iterable"
I tried googling stuff and looking through some previous answers here but I am confused!</p>

<pre><code>def sort_year(user_input):
    for i,j in range(0,9):
        if user_input == [ij00]:
            leap_yr1(user_input)
        else:
            leap_yr2(user_input)

def leap_yr1(user_input):
    if user_input % 400 == 0:
        print("The given year is a leap year")
    else:
        print("The given year is not a leap year")

def leap_yr2(user_input):
    if user_input % 4 == 0:
        print("The given year is a leap year")
    else:
        print("The given year is not a leap year")

print("Which year do you want to check?: ")
user_input = int(raw_input())
sort_year(user_input)
</code></pre>

<p>I think you try to write</p>

<pre><code>for i in range(0,9):
   for j in range(0,9):
</code></pre>

<p>But I think you try to check two last digits in <code>user_input</code> so you don't need <code>for</code>. </p>

<p>If <code>number</code> has <code>00</code> at the end then <code>number % 100 == 0</code> (here <code>%</code>  means function <code>modulo</code>)</p>

<pre><code>def sort_year(user_input):
    if user_input % 100 == 0:
        leap_yr1(user_input)
    else:
        leap_yr2(user_input)
</code></pre>

python python-2.7 int iterable