Answered step by step
Verified Expert Solution
Question
1 Approved Answer
how do i make a system which asks user to enter number of operations it wanna perform. and for each operation entered perform one of
how do i make a system which asks user to enter number of operations it wanna perform. and for each operation entered perform one of the operations such as remove name, add name or max length name.
i tried to do it and this is what i have so far plz let me know what i am doing wrong.
so like this is how i wnat my output to be (Everything in between "" is the input entered by user) :
steps = int(input("How many steps do you want to perform?")), names = [] for step in range(steps): names.append(str(input("Enter the command")>> for command in names: for add in command.split(): if 'add' in add: print(command) for commands in names: for remove in commands.split(): if 'remove' in remove: print(commands) How many operations would u like to peeform? (add, remove, max) "3"
Enter an operation: "add Maniac"
Maniac added
Enter an operation: "remove Sana"
Sana removed
Enter an operation: "max"
Max name in list is Zenish
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