What will the following code generate?cost = 87694.9456print(round(cost))A.87694B.87694.9C.87695
Question
What will the following code generate?cost = 87694.9456print(round(cost))A.87694B.87694.9C.87695
Solution
The code will generate C.87695.
Here's the step by step explanation:
- The variable
costis assigned the value 87694.9456. - The
round()function is used to round the value ofcostto the nearest whole number. - Since the decimal part of
costis .9456, which is greater than .5, the value is rounded up to the next whole number, which is 87695. - The
print()function is used to output the result, so 87695 is displayed.
Similar Questions
What will this code print?a = 3*2print(a)3265.weight: 5%What will the code print?
orrect answerWhat will be the output of the following Python expression?round(4.576)Options454.64.5
What will the following code generate?my_list = [20, 3, 10]total = 1for i in my_list: total = total * itotalA.500B.600C.33
Select the correct answerWhat will be the output of the following Python expression?print(round(10.5678))Options10.51010.611
The Quickprint Publishing Company plans to publish a vegetarian cookbook. The cost (in rand) to produce x𝑥 books is given by the function C(x)=2600+15x𝐶(𝑥)=2600+15𝑥. When interpreting C(150)=4850𝐶(150)=4850, the correctcorrect statement isSelect one:a. the variable cost to produce 150150 books is R2250R2250. b. the fixed cost to produce 150150 books is calculated as 150×R15150×R15. c. the total cost to produce 150150 books is R2600R2600. d. the marginal cost to produce 150150 books is R4850R4850.
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.