Exam 350-401 All QuestionsBrowse all questions from this exam
Question 779

What does the statement print(format(0.8, '.0%')) display?

    Correct Answer: D

    The statement print(format(0.8, '.0%')) formats the number 0.8 as a percentage with no decimal places. Multiplying 0.8 by 100 and then converting it to a percentage with no decimal places results in '80%'.

Discussion
dueOption: D

The statement print(format(0.8, '.2%')) will display the value 0.8 as a percentage with a precision of 2 decimal places, resulting in the output '80.00%'.

ColmenarezOption: D

Option D, 80%

alex711Option: D

Provided answer is correct

SeMo0o0oOption: D

D is correct. after reading the comments you say Ahaaa, that makes sense -_-

SeMo0o0oOption: D

D is correct. after reading the comments you say Ahaaa, that makes sense -_- 0.8 * 100 = 80

slacker_at_workOption: D

If you only want the percentage to be displayed as '8%' without any decimals, you would need to use a different formatting specification, such as '0%'. With this specification, 0.8 would be displayed as '8%'.