print('Welcome to a humble little screen control demo program')
print('')
screen_code = '\x1b[1A[\x1b[2K'
sys.stdout.write(screen_code)
a = input('What a: ')
a = a.strip()
sys.stdout.write(screen_code)
b = input('What b: ')
b = b.strip()
print('a=[', a, ']')
print('b=[', b, ']')
Delete the last input row in Python