ganiyuisholaafeez

Untitled

Feb 25th, 2020
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. def remove_and_replace(tech_companies):
  2.     remove = input("Enter the list to remove: ")
  3.     if remove in tech_companies:
  4.         idx = tech_companies.index(remove)
  5.         replace = input("Enter your replace here: ")
  6.         tech_companies[idx] = replace
  7.     return tech_companies
  8.  
  9. print(remove_and_replace(["Google", "Microsoft", "Blackberry", "IBM", "Yahoo"]))
Add Comment
Please, Sign In to add comment