What is the output of print(f'{0.5:.2%}') in Python?
print(f'{0.5:.2%}')
Correct answer
D. 50.00%
6 views
D. 50.00%
6 views
The % format spec multiplies by 100 and adds a percent sign.
Asked in: Python Interview Output Prediction
https://docs.python.org/3/reference/datamodel.htmlNot sure why the answer is D? Ask here and get an explanation.