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
