Explore Westonci.ca, the top Q&A platform where your questions are answered by professionals and enthusiasts alike. Discover a wealth of knowledge from experts across different disciplines on our comprehensive Q&A platform. Experience the ease of finding precise answers to your questions from a knowledgeable community of experts.

Read the following code, written to calculate an average:


def main():

num1 = 85

num2 = 95

num3 = 91


average = num1 + num2 + num3 / 3

print("Average: " + str(average))

main()


Which line of code has an error and why? (5 points)


A average = num1 + num2 + num3 / 3; It does not use quotation marks to indicate the string literal.

B average = num1 + num2 + num3 / 3; It does not follow the proper order of operations.

C print("Average: "str(average)); It requires an equal sign to properly calculate the output.

D print("Average: "str(average)); It requires a float() function to properly display the output


Sagot :

We hope our answers were helpful. Return anytime for more information and answers to any other questions you may have. We hope you found this helpful. Feel free to come back anytime for more accurate answers and updated information. We're dedicated to helping you find the answers you need at Westonci.ca. Don't hesitate to return for more.