0
Creat list with def function in python
I have a question. I want to write a function that takes a blank list, adds the word "Add" to the list and if "End" is printed, asks me whether i want to add, delete or seach the list. Please help!
14 Answers
+ 3
Please, read lesson 37.1 python for beginners course
+ 3
Fardin mn understand, there is no service for writing ready-made solutions for you and solving your homework. here is a place where people who are passionate about programming on a voluntary basis pull up newcomers who strive for knowledge and show it in practice. so far, we dont see that you have made any effort. no one will be able to learn the material instead of you. you have to go this way yourself.
+ 2
Hi! What help do you need?
+ 2
Hi, please post your written code so that it can be corrected or a suggestion on how to revise your code will be given. Try your best to write the code even though there are bugs, this is the way we learn here. Good luck. Thanks.
+ 2
def list():
list_name=[]
def add():
names=input("enter a name: ")
while names!="e":
list_name.append(names)
names=input("enter a name: ")
print(list_name)
add()
def remove():
x=input("enter a name that is erased : ")
if x==i:
for i in range(len(list_name)):
list_name.remove(x)
print(list_name)
remove()
list()
+ 1
The algorithm is like this:
1)create a empty list
2)add some name to the list
3)if the word "e" is written dont add anything anymore
4)ask wheather delete ,add or search the list
A function should be defined for all of them
0
I want to know how this function is written
0
Sorry, i forgot to say hello
0
Please write down if i can see where i am wrong
0
I am very very noob and newcomer
0
And i need your help
0
I'm so sorry for taking your time and thanks. If you now better solution for my problem i will be thankful if you let me now
0
Well I thing you have to understant what is class. Class contains funcions.
- 9
I need the written code