Question: Program 2 : interstate.py Primary U . S . interstate highways are numbered 1 - 9 9 . Odd numbers ( like the 5 or
Program :
interstate.py
Primary US interstate highways are numbered Odd numbers like the or go northsouth and
evens like the or go eastwest Auxiliary highways are numbered and service the
primary highway indicated by the rightmost two digits. Thus, I services I and I services I
Your program must also be able to detect invalid highway numbers. Note: is not a valid auxiliary
highway because is not a valid primary highway number.
Please enter an interstate number:
is not a valid interstate highway number.
Given a highway number, indicate whether it is a primary, auxiliary highway or an invalid highway
number. If auxiliary, indicate what primary highway it serves. Also indicate if the primary highway runs
northsouth or eastwest
Example Output
Please enter an interstate number:
I is auxiliary, serving I going northsouth
Please enter an interstate number:
I is primary, going northsouth
Skills Covered
Creating ifelseifelse statements
Creating nested ifstatements
Writing Conditional Expressions
Using Logical Operators
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
