Calculation priority problem with Spyder

24 views
Skip to first unread message

Argan Corvisy

unread,
Feb 13, 2020, 10:54:01 AM2/13/20
to spyder
Hi everybody,

I'm Argan, french student.

I had problem with Spyder on windows, as a consequence I started to use it on Ubuntu 18.04.4 LTS.

But, now, I have problems with exactly the same programs I created on windows spyder. Especially calculation priority :

For example :

Screenshot from 2020-02-12 14-52-07.png


Does anybody have an idea ? Is it maybe package or an installation problem ?


Nota : 

Screenshot from 2020-02-12 15-06-35.png


Best regards


bcolsen

unread,
Feb 13, 2020, 1:53:17 PM2/13/20
to spyder
Are you using python2.7?  If so that is the correct result because python 2.7 won't return a float from the division of 2 integers. So you get 2/3 = 0 and 6/4=1 then 0*1=0

In python 3 you get:

In [15]: (2/3)*(6/4)

Out[15]: 1.0


You should use python 3 if you are learning.
Reply all
Reply to author
Forward
0 new messages