Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Get the user input and create a thematic list of strings. The program should ask for specific input theme. For example: name of the planets

image text in transcribed

Get the user input and create a thematic list of strings. The program should ask for specific input theme. For example: name of the planets in the solar system, name of your favourite vegetables, list of programming languages you hope to learn, etc. The user should enter strings for the list until a condition is met such as entering a specific word or character. There should not be hard code list size. Each user input should be one list element. Then process the list as follows: 4) Count and display a list of the length of each element in the list with a relevant message. 5) Use the random function to generate a random number between 0 and the maximum length of the list. This number will be used as an index to the list elements. The following code generates a random integer between 1 and 10. Import random print(random.randint(1, 10)) 6) Have the user enter a character of their choice and check if the character exists in the string with the index number just generated at random. 7) For example: a) The list is ["Mars", "Venus", "Earth", "Saturn", "Pluto"] b) The index number generated at random is 3 c) The user enters character 'A' d) The program checks to see if 'A' is in the list element with the index of 3. e) The program should display a relevant message if the character is found in the string. The search for the character should return true regardless if the user enters a lowercase 'a' or an uppercase 'A'. If the letter exists in the string either in uppercase or lowercase, the search should return true and a relevant message should be displayed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions

Question

What is the best conclusion for Xbar Chart? UCL A X B C B A LCL

Answered: 1 week ago