Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started