# Tuple ## Read Only, Duplicates Allowed, Add and delete but not change values # Ask the user for the payment info ccNum = input("Credit Card Number: ") # paymentInfo[0] ccExp = input("Enter Exp (MM/YY): ") # paymentInfo[1] ccCVC = int(input("Enter the CVC Code: ")) # paymentInfo[2] # Create an empty tuple paymentInfo = () # len 3 [0],[1],[2] # Populate the empty tuple with the user input paymentInfo = (ccNum, ccExp, ccCVC) # create the tuple from the empty object # Print the tuple elements print("CC Number: ", paymentInfo[0]) print("CC Exp:", paymentInfo[1]) print("CC CVC Code: ", paymentInfo[2]) # Ask the user to confirm the biller zip code contactZipCode = int(input("Enter your zip code: ")) paymentInfo += (contactZipCode,) # existing paymentInfo tuple and appending a new tuple to the end print(paymentInfo) # 4 items in your tuple with zipCode[3] # Convert the tuple to a list to change an item paymentInfo_List = list(paymentInfo) # var = list(?tuple) # Ask the user for an updated cvc code i_newCVCCode = int(input("Enter a new CVC Code: ")) paymentInfo_List[2] = i_newCVCCode #Convert back to the original tuple name paymentInfo = tuple(paymentInfo_List) # important to use the original tuple name for the app print(paymentInfo)