What is the output of the following Python code snippet?
x = 5
print(f'{x = }')
print(f'{x = }')
Correct answer
A. x = 5
7 views
A. x = 5
7 views
The = specifier in f-strings (3.8+) prints the expression and its value.
Asked in: Python Interview Output Prediction
https://docs.python.org/3/reference/datamodel.htmlNot sure why the answer is A? Ask here and get an explanation.