Test Index
Python Revision Tour
© examsnet.com
Question : 85 of 102
Marks:
+1,
-0
What will the following expression be evaluated to in Python ?
print(4+3*5/3-5%2)
[CBSE 2023 Set 4]
Solution:
Concept:Precedence:
*, /, % (left to right) before +, -. The operator / always gives a float.Explanation:Step 1: 3*5 = 15Step 2: 15/3 = 5.0Step 3: 5%2 = 1Step 4: 4 + 5.0 - 1 = 8.0The result is a float because of the /, so it is 8.0 and not 8.Answer:Option B (8.0)© examsnet.com
Go to Question: