multiple conditions to a if loop python
<p>Hello I'm having some problems with some code I am writing for a school and its not working. It wont run through the whole loop but all the code looks right to me. Does anyone have any ideas?</p>

<pre><code>   User_Input = input ( "Please enter a message that is no longer than 7 characters." )
    User_Input_Length = len ( User_Input )  
    if     {  User_Input_Length &gt;= 7 
         and  User_Input_Length == 1
    }:
    print ( "Your message is odd." )
    elif   {  User_Input_Length &gt;= 7
         and  User_Input_Length == 3
    }:
    print ( "Your message is odd." )
    elif   {  User_Input_Legnth &gt;= 7
         and  User_Input_Length == 5
    }:
    print ( "Your message is odd." )
    elif   {  User_Input_Length &gt;= 7
         and  User_Input_Length == 7
    }:
    print ( "Your message is odd" )
    elif   {  User_Input_Length &gt;= 7
         and  User_Input_Length == 2
    }:
    print ( "Your message is even" )
    elif   {  User_Input_Length &gt;= 7
         and  User_Input_Length == 4
    }:
    print ( "Your message is even" )
    elif   {  User_Input_Length &gt;= 7   
         and  User_Input_Length == 6
    }:
    print ( "Your string is even" )
    else:
    print ( "The string is too long." )
    print ( "Goodbye" )
</code></pre>

<p>Those braces are for defining sets, and a non-empty set always evaluates to true, so your code will always evaluate the first if.</p>

<p>Python doesn't requires parenthesis (or braces) around if statements.</p>

python