def confirm_choice():
confirm = input("[c]Confirm or [v]Void: ")
if confirm != 'c' and confirm != 'v':
print("\n Invalid Option. Please Enter a Valid Option.")
confirm_choice()
print (confirm)
return confirm
When an invalid input has been keyed in for example, the letter 'k' followed by a valid input 'c', the function would print both inputs 'c' and 'k'
Output:
c
k
How can the above program be altered so that it returns only either 'c' or 'v'and repeats the function if the input is invalid.