Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hi i need help with this. (Instead of directly printing the information of a highway number, the interactive version - keeps asking the user for
Hi i need help with this.
(Instead of directly printing the information of a highway number, the interactive version - keeps asking the user for a highway number until the number they enter is valid, - then asks the user if they want to know the type or the direction of the valid highway number, and - finally prints the corresponding information. For more details on how the program works, check out the lecture from Monday 02/27. For this homework, you need to organize the code by defining two functions: 1. The first function is called get_highway_number and its job is to get a valid highway number from the user. 2. The second function is called print_highway_info and its job is to print the type or the direction. The two functions should be called from a main function, and there should be nothing else in the main function. Eventually, the structure of the code should look like this: def get_highina_numero: \# Type your code here and delete the next line pass def print highway_info (n) : i. Type your code here and delete the next line pass if _name ... "moin_." n= get_highway number() print_highway,info(n) Download the template here: interstatehighway interactive function.py, and fill in the definition of the two functions. Note: Your program should behave exactly the same as the original non-function version. nteractive_function.py def get_highway_number(): \# Type your code here and delete the next line pass def print_highway_info (n) : \# Type your code here and delete the next line pass if _name ==" main ". n= get highway number() print_highway_info (n) Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started