Does python use the principles of BODMAS? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Does python use the principles of BODMAS?

For example use division before multiplying and multiplying before addition and subtraction? 9 + 6 / 3 = 11 whereas (9 + 6) / 3 = 5

23rd Nov 2019, 3:05 AM
Zeus K
Zeus K - avatar
2 Respostas
+ 6
It uses PEMDAS I guess. Where P is parenthesis and E is exponentiation.
23rd Nov 2019, 3:12 AM
Avinesh
Avinesh - avatar
+ 1
In programming languages you have to care about the order of far more types of procedures than in maths class. What you need to look for is the term 'operator precedence'. For Python, you find it here (scroll down quite a bit): https://docs.python.org/3/reference/expressions.html
23rd Nov 2019, 12:24 PM
HonFu
HonFu - avatar