Skip to content

Instantly share code, notes, and snippets.

Created September 7, 2017 16:58
Show Gist options
  • Select an option

  • Save anonymous/4b752ddef3387e61c4594f0770d8ecdd to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/4b752ddef3387e61c4594f0770d8ecdd to your computer and use it in GitHub Desktop.

Revisions

  1. @invalid-email-address Anonymous created this gist Sep 7, 2017.
    20 changes: 20 additions & 0 deletions remove.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    def removeCoin():
    coinlist = ["a", "b", "c", "d"]
    while True:
    print("\nThe list of coins you're currently tracking is: \n" + "\n".join(coinlist) + "\n")
    yes_or_no = input("Do you want to remove a coin from the list? (Y/N):").upper()

    if yes_or_no == "Y":
    try:
    coinlist.remove(input("Which coin do you want to remove?").upper())
    print("\nThe list of coins you're currently tracking is: \n" + "\n".join(coinlist) + "\n")
    except ValueError:
    print("There is no such coin in the list")

    if yes_or_no == "N":
    return coinlist

    else:
    "You didn't input a valid coin"

    removeCoin()