I present the following example code (in python), where I want to overwrite the error messages, so that it does re-appear in the same terminal space (& not in the following terminal space) if the user inputs an invalid value (single or many times)? Kindly help.
# bug condition (Numeric character value)
num_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
tracker = 0
while True:
value = input("\n\t Enter the value - ")
for num in num_list:
if num in value: # numeric character is present
print("\n\t\t Error: Invalid value.")
print("\t\t Note - Make sure that the entered value does not contain numeric characters.")
tracker += 1
break
if tracker >= 1: # if the user inputted invalid value (one or more times)
continue # re-input again
else: # if the input is valid
break # break & proceed forward
# the end -------------------------------------