Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Got stuck here and i would appreciate it very much if someone could help me out, i cant seem to figure out how to do

Got stuck here and i would appreciate it very much if someone could help me out, i cant seem to figure out how to do things after this..

here is what i have so far

list_one = []

welcome_msg = int(input("How many steps should we run?" ))

for i in range(welcome_msg): msg_input = input("Enter a command: ") list_one.append(msg_input) print(list_one)

I want it to look like this, and here is some instructions too

image text in transcribed

For each step do one of the three things here: 1. "add [name]" -add name to list 2. "remove [name]" remove name from list a. if the name is not in the list, inform the user and don't crash 3. "max" output the max length name, if there is a tie, then output the last name in lexicographic order. (you are not permitted to use .sort) or sorted) for this, instead consider using the operators for strings) Lexicographic means the result of the operator> We won't use spaces in the name, so you can use split again. linux [0] $ python3 py How many steps should we run? 6 Enter command: add Alex Alex added. Enter command: add Samantha Samantha added. Enter command: add Jill Jill added. Enter command: max The max name is Samantha Enter command: remove Samantha Samantha removed. Enter command: max The max name is Jill

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

Students also viewed these Databases questions

Question

=+ (c) Show that f is a measure on Fand agrees with a on Fo.

Answered: 1 week ago

Question

What are some of the possible scenes from our future?

Answered: 1 week ago