Question: highway _ number = int ( input ( ) ) # Check if the highway number is valid if 1 < = highway _ number
highwaynumber intinput
# Check if the highway number is valid
if highwaynumber :
# Primary highway
direction "northsouth if highwaynumber else "eastwest
printfIhighwaynumber is primary, going direction
elif highwaynumber :
# Auxiliary highway
primaryhighway highwaynumber
direction "northsouth if primaryhighway else "eastwest
printfIhighwaynumber is auxiliary, serving Iprimaryhighway going direction
elif highwaynumber or highwaynumber :
# Invalid highway number with last two digits as
printfhighwaynumber is not a valid interstate highway number."
else:
# Invalid highway number
printfhighwaynumber is not a valid interstate highway number."
I cant get case to output correctly. :Primary
Input
Your output
I is primary, going eastwest
:Auxiliary
Input
Your output
I is auxiliary, serving I going eastwest
:Invalid
Input
Your output
is not a valid interstate highway number.
:Compare output
Output differs. See highlights below.
Special character legend
Input
Your output
I is auxiliary, serving I going eastwest
Expected output
is not a valid interstate highway number.
:Compare output
Input
Your output
I is primary, going northsouth
:Compare output
Input
Your output
I is auxiliary, serving I going northsouth
:Compare output
Input
Your output
is not a valid interstate highway number.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
