Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is Python programming Language. Get the user input and create a thematic list of strings. The program should ask for specific input theme. For

image text in transcribed
This is Python programming Language.
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

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions

Question

Q.1. what is constitution? Q.2. key of the constitution?

Answered: 1 week ago

Question

Q.1. what is meant by federal system?

Answered: 1 week ago