Python Forum

Full Version: Nested IF statements
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am very confused by the professor's instruction on this problem of my homework. Please help me understand where to begin here. I feel like the grammar here is confusing me


#problem 8
#Using the two following variables, compare them to each other and two
#use separate nested IF statements, if both variables are odd numbers,
#write "Both are odd." to the screen and
#write nothing if not true.

number1 = 5
number2 = 2
I think he's looking for something in the form of:

if something:
    if something_else:
        do_something()