(1) Chang the file name and UPI constant, and implement the get user input funct
ID: 3746810 • Letter: #
Question
(1) Chang the file name and UPI constant, and implement the get user input function. [8 marks] Rename the 'A101 . py, file into AIQ1 followed by your UPI, eg, 'A101 abcd0 01 ... Assign your own UPI to the UPI constant variable defined in the display_intro) function of the A1Qlabcd001.py' file Implement the get-user-input (start, end) function inside the ‘A101abcd001., program which receives an user choice of the menu option. The function should only accept a valid user input, i.e., a number between 1 and 6 (both inclusive). Any other numbers or value (e.g., non-digit characters) will be ignored. Its exact layout should have the same format as shown below -- A Phone Book Management Program by abcd001 -- 1. Look up a contact 2. Add a new c ntact 3. Change an existing contact 4. Delete a contact 5. Display all contacts 6. Quit the program Enter your choice: 8 Invalid menu option. Please try again: E Invalid menu option. Please try again: 0 Please try again: hello Invalid menu option. Please try again: 6 Thank you!Explanation / Answer
As question asked to plement get_user_input function so only implemented that as it requires A1Q1.py to integrated i believe.
Please find below the program
#A1Q11bcd001.py
#output
--------------------------------------------------
-- A Phone Book Management Program by abcd001 --
--------------------------------------------------
1. Look up a contact
2. Add a new contact
3. Change an existing contact
4. Delete a contact
5. Display all contacts
6. Quit the program
--------------------------------------------------
Enter your choice: i
Invalid menu option.
Enter your choice: -564
Invalid menu option.
Enter your choice: 6
--------------------------------------------------
Thank You
--------------------------------------------------
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.