Question: The below is a python code. print('sum of {} and {} is ; product: {}. ..format a. Nothing - it causes an error. b. sum

The below is a python code.

print('sum of {} and {} is ; product: {}. ..format a. Nothing - it causes an error. b. sum of {} and {} is {} ; product: {} c. sum of 2 and 6 is 8 ; product: 12 d. sum of and is ; product:

Sol251:

The code contains syntax errors. Here's the corrected code:

x = 2

y = 6

print('sum of {} and {} is {}; product: {}'.format(x, y, x+y, x*y))

The output will be: sum of 2 and 6 is 8; product: 12

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!