Check sibling questions
Computer Science - Class 12
Solutions to CBSE Sample Paper - Computer Science Class 12

What will the following expression be evaluated to in Python?

print(15.0 / 4 + (8 + 3.0))

(a) 14.75


(c) 15

(d) 15.5



Question 14 -Teachoo.png

So, the correct answer is (a) 14.75



Step 1: In python, the content inside the parentheses is evaluated first. So the expression becomes (15.0 / 4 + (11.0))

Step 2: ‘/’ takes precedence over ‘+’. So the expression becomes (3.75 + 11.0)

Step 3: The final evaluation is done and the answer is 14.75

Learn in your speed, with individual attention - Teachoo Maths 1-on-1 Class

Ask a doubt
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 13 years. He provides courses for Maths, Science, Social Science, Physics, Chemistry, Computer Science at Teachoo.