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
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
Chapter8: Arrays
Section: Chapter Questions
Problem 5PE
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
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 2 images
Knowledge Booster
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.Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT