Advanced search

Python help please!

(7 Posts)
irvine101 Fri 25-Dec-15 17:04:40

Merry Christmas every one! fsmile (DH is cooking, and I'm having a quiet moment!)

I'm not good at computing. Sorry for silly question.
I was completely lost with difference between python2 and python3.
What's the difference?
It's only because the course I want to do is on python2, and python3 doesn't seem to work the same way. Do I need to get python2 as well?
I thought later version must be better, is it not?

irvine101 Fri 25-Dec-15 18:54:55

For the record, it's not actually for me, I'm only testing this for my ds.

prh47bridge Sun 27-Dec-15 01:11:18

Python 3 is the current version. Unusually for a computer language it is intentionally not backwards compatible, so code written for Python 2 may not work in Python 3. A lot of things haven't changed but the language has been tidied up considerably.

If the course is on Python 2 I would recommend sticking to Python 2 for the moment. Due to some of the changes that have been made it is very difficult to write code that runs on both Python 2 and Python 3.

irvine101 Sun 27-Dec-15 10:18:34

Thank you, prh47bridge, that makes sense.
My ds is learning Python for first time. Is it worth doing this course, or should I find other course for Python3?

irvine101 Sun 27-Dec-15 10:34:00

Only reason I choose this course was because objective was to write simple factorial programme and Fibonacci programme, which is right up to ds's interest, but wondering introducing 2 instead of 3 might be confusing if he wants to learn further later on?

prh47bridge Mon 28-Dec-15 00:47:06

Python 2 is still far more common in real world usage than Python 3. Indeed, over 1 in 5 Python developers think 3 is a mistake. I would start him on 2. If he ever needs to use 3 he should find it easy to learn at a later stage.

irvine101 Mon 28-Dec-15 07:21:18

Thank you prh47bridge. I'm really glad I asked the question now!!

Join the discussion

Join the discussion

Registering is free, easy, and means you can join in the discussion, get discounts, win prizes and lots more.

Register now