Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1) CODE IN PYTHON: a) Write a script that takes in two strings from the user. If one string is the suffix of the other

1) CODE IN PYTHON:

a) Write a script that takes in two strings from the user. If one string is the suffix of the other string, print the suffix, otherwise, print "No suffix found". For example, if the user enters "brush" and "paintbrush", then the script would print "brush". If the user entered "painting" and "painted", the script would print "No suffix found" because no string ends with the other. Keep in mind that the the pair "brush" and "paintbrush" as well as the pair "paintbrush" and "brush" would print "brush" because order does not matter.

b) Take in a number, n, from the user. Then, take in n integers from the user and store them in a list. For instance, if the user enters 4, then the user will have to enter 4 numbers. Print the list and the median of the list. Do not use any modules, neither standard library nor third party.

c) Create a 2D list of space 5x5 filled with zeroes. Take in three coordinates (row and column) from the user. Modify the list to store 1s in the space of the entered coordinates. Print out resulting matrix. Your printed matrix must be formatted like the screenshot below.

d) Take in strings until the user types "EXIT" and store the strings in a list. Create another list of just the strings which are positive integers. Do not actually store the coerced numbers, just the original strings. Print both lists.

e) Take in 10 integers from the user and store them in a list. Create a new list with only elements which appear twice. Print both lists.

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

JDBC Database Programming With J2ee

Authors: Art Taylor

1st Edition

0130453234, 978-0130453235

More Books

Students also viewed these Databases questions

Question

Write MATLAB code to calculate the 5 fifth roots of - 1 .

Answered: 1 week ago

Question

Define Administration and Management

Answered: 1 week ago

Question

Define organisational structure

Answered: 1 week ago

Question

Define line and staff authority

Answered: 1 week ago

Question

Define the process of communication

Answered: 1 week ago

Question

Explain the importance of effective communication

Answered: 1 week ago