Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """ Instructions
- Write an if statement in the_flying_circus(). It must include:
- 1.)if, elif, and else statements;
- 2.)At least one of and, or, or not;
- 3.)A comparator (==, !=, <, <=, >, or >=);
- 4.)Finally, the_flying_circus() must return True when evaluated. """
- """ Solution
- We can easily gather following four points from the instructions given:
- 1.)Our solution should have if, elif and else statements.
- 2.)It should at least have one of [and, or, not]
- 3.)We should use a comparator
- 4.)Our function should evaluate to True.
- Simply just check for two conditions in your conditional statements.
- For example:
- if 3>2 and 3>1:
- if x%2 == 0 or x%2 == 1:
- a more general statement:
- if True or False:
- if True and True:
- if False and False:
- if not False:
- Return True in every conditional statement.
- For example:
- if 3>2 and 3>1:
- return True
- if x%2 == 0 or x%2 == 1:
- return True
- if True or False:
- return True
- """
- # Make sure that the_flying_circus() returns True
- def the_flying_circus():
- if ________:
- # Don't forget to indent
- # the code inside this block!
- elif ________:
- # Keep going here.
- # You'll want to add the else statement, too!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement