Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Nested IF statements
#1
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
Reply
#2
I think he's looking for something in the form of:

if something:
    if something_else:
        do_something()
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  having an issue with nested if statements fad3r 6 4,653 May-08-2018, 12:25 AM
Last Post: ljmetzger
  Nested loops, lists and if statements Liquid_Ocelot 10 8,938 Apr-23-2017, 02:02 PM
Last Post: Mekire

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020