SHARE
TWEET

Untitled

a guest Jul 17th, 2019 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. outfile = open(file_name, "w")
  2.     for i in card_list:
  3.         outfile.append(str(card_list[i]) + "n")
  4.      
  5. try:
  6.     card_list=[]
  7.     for i in range (5):
  8.         card = int(input("Enter a card number: "))
  9.         while card <1 or card > 13:
  10.             print("Invalid Card")
  11.             card = int(input("Enter a card number: "))
  12.         card_list.append(card)
  13.     print(card_list)
  14.  
  15.     file_name = input("What name would you like to save them as? ")
  16.  
  17.     outfile = open(file_name, "w")
  18.     for i in card_list:
  19.         outfile.append(str(card_list[i]) + "n")
  20.     print()
  21.     print("Your cards were successfully saved.")
  22.     print()
  23. except ValueError:
  24.     print()
  25.     print("Card must Be an integer not a string.")
  26.     print()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top