What is wrong with the following code snippetSolutionAnswer

What is wrong with the following code snippet?

Solution

Answer:

Issue here is with this statement

this statement we mentioned in first line but by that time num1, num2, num3 variables not created so this statement should be before last print statement.

Below code is the correct one.


num1 = 20
num2 = 10
num3 = 2
result = num1 // num2 / num3
print(result)

Output: 1

Explanation: 20/10/2 = 2/2 = 1

What is wrong with the following code snippet?SolutionAnswer: Issue here is with this statement this statement we mentioned in first line but by that time num1,

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site