Write a Python program with a function that will receive a list as an argument and write an function "if '_name_' == __main_:" block to call the function. 1. When the program starts running, the user is asked to input six (6) numbers, one at a time, and a list is built. Use a loop to achieve that. 2. The function is called with the list of six numbers as a single argument. 3. The function will ask the user to input a number. It will find and return the index of that number in the list. 4. If the number is not an element of the list, the function returns the string "unknown" and asks the user to try again. There can be a total of 3 possible failed trials, after which the program will return a message to the user and exit. Choose your own exit message

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 5PE
icon
Related questions
Question
Write a Python program with a function that will receive a list as an argument and write an function "if '_name_' == __main_:" block to call the function. 1. When the program starts running, the user is asked to input six (6) numbers, one at a time, and a list is built. Use a loop to achieve that. 2. The function is called with the list of six numbers as a single argument. 3. The function will ask the user to input a number. It will find and return the index of that number in the list. 4. If the number is not an element of the list, the function returns the string "unknown" and asks the user to try again. There can be a total of 3 possible failed trials, after which the program will return a message to the user and exit. Choose your own exit message.
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Linked List Representation
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT