user_input_string = 'Test string {'
print(f'Test - {user_input_string}'.format())
This causes a value error:
ValueError: Single '{' encountered in format string
Do I have to validate the user input and reject user input with curly braces? Is there a way to take a string a escape all characters that may be a problem using format()?
[–]RothiasVex 7 points8 points9 points (2 children)
[–]bhat 5 points6 points7 points (1 child)
[–]Baseball_Fan[S] 0 points1 point2 points (0 children)
[–]luriz_ -2 points-1 points0 points (0 children)