I am new to this specific Q&A site and I got my rep off of association bonuses, and I wanted to ask how to fix my code to work for another version of python.

I noticed the text "Post code that is already working" and went here to ask if it is ok to post this question here or to put it on SO.

  • 6
    Do you want to ask a question about "This code works in Python 2. How can I make this code also work in Python 3, so that it works in both Python 2 and Python 3 simultaneously?" or do you want to ask "This code works in Python 2, how can I improve my current code? (Without necessarily also making it work for Python 3)" – Simon Forsberg Jul 13 at 23:13
  • I agree with Simon. I voted to close this as unclear until the question is clarified. – Phrancis Jul 13 at 23:23
up vote 11 down vote accepted

Can you post code that works on one version of a interpreter (ex:Python 2) but not on another (ex:Python 3)

Yes, we currently tag questions with if it runs in a version or both versions of Python. We also tag the question with or if it runs in only one of these versions.

I am new to this specific Q&A site and I got my rep off of association bonuses, and I wanted to ask how to fix my code to work for another version of python.

Asking the specific question on how to make your code compatible with another version of Python would be off-topic, as the code wouldn't work in the intended version. Yes it works in say Python 2, but it would error in Python 3, and so would be off-topic.

For completeness, if your code did work in both versions or just the version that you want it to work in, then it would make no sense asking a question like "How do I make this work in Python 3.x" when it works in Python 3.x. And so would likely be treated as a normal question.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .