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
Get step-by-step solutions from verified subject matter experts
