Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON need help with this question thanks in advance 4. 12 points Write a program to first repeatedly ask the user for a short string

image text in transcribed

PYTHON need help with this question thanks in advance

4. 12 points Write a program to first repeatedly ask the user for a short string which is appended to a list, then after the user enters , again repeatedly ask the user for a string, which this time is added to a tuple. Once the user enters , the program should display: a) the list and the tuple of user's strings b) All the strings that appear in both collections - the list and the tupple c) Number of the strings that appear in both collections Hint: a tuple containing a single element a, is coded as (a,) not as (a) A typical run might look like: adding to a list please enter a short string or to terminate aaa please enter a short string or to terminate abc please enter a short string or to terminate bbb please enter a short string or to terminate bcd please enter a short string or to terminate ccc please enter a short string or to terminate cde please enter a short string or to terminate now adding to a tuple please enter a short string or to terminate abc please enter a short string or to terminate cde please enter a short string or to terminate fgh please enter a short string or to terminate your list: ['aaa', 'ab', 'bbb', 'bcd', 'ccc', 'cde'] your tuple: ('abc', 'cde', 'fgh') string abc is in both list and tuple string cde is in both list and tuple 2 strings are in both

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_2

Step: 3

blur-text-image_3

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

How To Make A Database In Historical Studies

Authors: Tiago Luis Gil

1st Edition

3030782409, 978-3030782405

More Books

Students also viewed these Databases questions

Question

What is focal length? Explain with a diagram and give an example.

Answered: 1 week ago

Question

What is physics and how does it apply in daily life?

Answered: 1 week ago

Question

7. Define cultural space.

Answered: 1 week ago

Question

8. Describe how cultural spaces are formed.

Answered: 1 week ago