« first day (3761 days earlier)      last day (1187 days later) » 

9:15 AM
I need 2 votes to reopen from reviewers to reopen this question. It was closed as off topic most likely bercause it was a considered to be a programming question but actually there is nothing wrong with the code, so it's an Ubuntu question.
 
 
2 hours later…
11:04 AM
@karel Why is that an Ubuntu question? It is about the differences in syntax between python2 and python3. I think it is off topic, it isn't even about writing a script on Ubuntu, the only issue is python versions. Since you've answered it and the OP is happy, reopening it would not serve any function, I think. It would just give us an off topic question.
 
I was thinking about the different results in the terminal vs. in Jupyter notebook and that the OP was using Jupyter notebook because he didn't know that he could also run Python code snippets from cell formatted prompts in the terminal with IPython. There isn't any code in the question at all. It's all about which terminal program to use which is a software recommendation.
It's a software question that got promoted to being a programming question because the incorrect software returned a syntax error through no fault of the error-less Python code in the question.
 
11:29 AM
@karel What do you mean? Most of the question is code.
python3 will give 3.1415926535897922 and python2 will give 2.0
In fact, I don't even get syntax errors on python 2.7.18
Neither does the OP, the syntax error was a typo and has already been fixed in the OP's screenshot
This will come down to how python2 handles floats. The floating precision was greatly improved for python3 as I recall. I've also seen something similar:
5
Q: Why do 4 different languages give 4 different results here?

terdonConsider this (all commands run on an 64bit Arch Linux system): Perl (v5.24.0) $ perl -le 'print 10190150730169267102/1000%10' 6 awk (GNU Awk 4.1.3) $ awk 'BEGIN{print 10190150730169267102/1000%10}' 6 R (3.3.1) > (10190150730169267102/1000)%%10 [1] 6 bc $ echo 10190150730169267102/1000%1...

> In bc and Python 2, we're working with arbitrary-precision integers and integer division. Both those languages can represent the numerator exactly. The division result is then 10190150730169267 (we're doing integer division, not true division, so the fractional part is discarded), and the remainder modulo 10 is 7. (This is oversimplifying a bit: the format that bc is using internally is somewhat closer to Python's Decimal type than to an arbitrary-precision integer type, but in this case the effect is the same.)
 
 
10 hours later…
9:39 PM
Hmmm, not sure how to answer this guy because a UUID is not a MAC address: askubuntu.com/questions/1308387/…
"Old" MAC addresses are still used today.
 

« first day (3761 days earlier)      last day (1187 days later) »