Deleting elements in Python list using user input -
name=input("enter name: ") message=input("enter message:") namefinal=list(name) namefinal in message: del(namefinal) print(message)
i need creating program gets message user , removes of letters in user’s name. made user input(name)
list don't know how delete letters. example if type in charan
, message lebron james
delete r,a,and n lebron james, making lebo jmes
.
you can this:
name=input("enter name: ") message=input("enter message:") namefinal = '' letter in name: if letter not in message: namefinal += letter print namefinal
Comments
Post a Comment