subject

Primary U. S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, I-405 services I-5, and I-290 services I-90. Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also indicate if the (primary) highway runs north/south or east/west.
Ex:
If the input is 90
the output is
I-90 is primary, going east/west.
Ex: If the input is
290
the output is
I-290 is auxiliary, serving 1-90, going cast/west.
Ex: If the input is:
0
the output is
0 is not a valid interstate highway number.
1 nighway_number - int(input)
2
3 *** Type your code here. "
4 if highway_number - 0:
5 print(highway_number, 'is not a valid interstate highway number.')
6 if highway_number in range(1, 99-1):
7 if highway..number % 2 - :
8 print('I-' highway number, "is primary, going east/west.")
9 else
10 print("I-' highway_number, "is primary, going north/south."
11 else:
12 served - highway_number % 100
13 if highway number - 1000: print highway_number, 'is not a valid Interstate highway number.') 15 if highway number in range(99, 999.1):
16 if highway_number 2 - 0 print('I..highway_number, 'is auxiliary, serving I.', 'x. f.' Xserved, 'going eastwest.)
17
18 else:
19 print('1', highway_number, 'is auxiliary, rving I-','%.f.' Xserved, 'going north/south.)
19 Develop mode Submit mode
Input 90
Your output I- 90 is primary, going east/west.
Expected output I-90 is primary, going east/west. 0
2: Auxiliary (290)
Output is nearly correct; but whitespace differs. See highlights below.
Input 290
Your output 1- 290 is auxiliary, serving I- 90, going east/west. I-290 is auxiliary, serving 1-90, going east/west.
Expected output
3 Invalid (0) 1/1
Input 0
Your output is not a valid interstate highway number.
4. Compare output 0/2 Output is nearly correct; but whitespace differs.
Input
Your output

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 15:00, abelxoconda
1. which of the following statements are true about routers and routing on the internet. choose two answers. a. protocols ensure that a single path between two computers is established before sending packets over it. b. routers are hierarchical and the "root" router is responsible for communicating to sub-routers the best paths for them to route internet traffic. c. a packet traveling between two computers on the internet may be rerouted many times along the way or even lost or "dropped". d. routers act independently and route packets as they see fit.
Answers: 2
image
Computers and Technology, 23.06.2019 21:30, jayybrain6337
Enzo’s balance sheet for the month of july is shown. enzo’s balance sheet (july 2013) assets liabilities cash $600 credit card $4,000 investments $500 student loan $2,500 house $120,000 mortgage $80,000 car $6,000 car loan $2,000 total $127,100 total $88,500 which expression finds enzo’s net worth?
Answers: 1
image
Computers and Technology, 24.06.2019 00:00, amy7233
Afashion designer wants to increase awareness about her brand. which network can she use and why she can use the blank to blank her products online. answers for the first blank: internet, extranet, or intranet answers for the second blank: market, design, and export
Answers: 1
image
Computers and Technology, 24.06.2019 01:30, shonnybenskin8
Hazel has just finished adding pictures to her holiday newsletter. she decides to crop an image. what is cropping an image?
Answers: 1
You know the right answer?
Primary U. S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south,...

Questions in other subjects:

Konu
English, 10.02.2021 19:50
Konu
Chemistry, 10.02.2021 19:50