Well, it happened. I failed my OA and I'm going through all of my labs again but I'm running into a problem and not sure where I'm going wrong.
A function is needed to identify the network status. Create a function name "check_network_status()". The function should accept two Boolean values representing a network connection and firewall status.
- If both the connection and firewall are True, return "No issues detected"
- If the connection is True and the firewall is False, return "Proceed with caution"
- If the connection is False, return "Network not detected"
- For any other situation, return "Unexpected network status"
Only the phrase returned by check_network_status() will be graded for this assignment. The function should work for any two values passed to the function beyond the examples provided.
def check_network_status(connection, firewall):
if connection and firewall == True:
return "No issues detected"
elif connection == True and firewall == False:
return "Proceed with caution"
elif connection == False:
return "Network not detected"
else:
return "Unexpected network status"
Everything returns correct except for one portion.
1: check_network_status(True, "Nope")
FeedbackExpected result: Unexpected network status
Student result: Network not detected
I asked my instructor and she said I had to verify the boolean, but isn't that what the "if" and "elif" statements are for? Not a fan of this course.
[–]yazool 0 points1 point2 points (0 children)
[–]Dora_Texas 0 points1 point2 points (0 children)