Skip to main content
Added source fence with language code. Stylized tech name.
Source Link
bad_coder
  • 12.7k
  • 2
  • 19
  • 51

In my opinion, you are not permitted to simply change the code that has been given in the context of pythonPython 2 being around and most popular.

There is a huge danger of decoupling questions and answers and comments from each other by doing so.

I think there are several options:

  • Provide a new answer, title it with "Solution for python 3".

    Provide a new answer, title it with "Solution for Python 3".
  • Comment below the answer or question, saying that this code will only be working in python 2, because of reason X.

    Comment below the answer or question, saying that this code will only be working in Python 2, because of reason X.
  • Edit the question or answer with "Note that this code runs in python 2".

    Edit the question or answer with "Note that this code runs in Python 2".
  • Edit the question or answer by providing comments in the code like

      a = raw_input("ask: ")  # use input("ask: ") for python3
    
    Edit the question or answer by providing comments in the code like
a = raw_input("ask: ")  # use input("ask: ") for python3

In any case, do not change the code.

If the question and its answer are really specific to pythonPython 2, don't change anything, just make sure it has the python-2 tag.

When answering pythonPython questions, make them as compatible as possible with both versions. E.g. range(N) or print(head) will work in both versions (so the example in the question may acutally be one of the very rare cases where code may be changed - however best in consent with the posts author.); where necessary simply import from __future__. When using pythonPython 3, leave a comment in the line which might be different for pythonPython 2.

Remember: Python 2 is not dead (yet), it is still used more often than you might think, especially in productive, educational and scientific environments from where the highest demand for quick solutions on SO arises.

To simply put some numbers into play, here is a graph from a 2016 python-developers-survey:

enter image description here

In my opinion, you are not permitted to simply change the code that has been given in the context of python 2 being around and most popular.

There is a huge danger of decoupling questions and answers and comments from each other by doing so.

I think there are several options:

  • Provide a new answer, title it with "Solution for python 3".

  • Comment below the answer or question, saying that this code will only be working in python 2, because of reason X.

  • Edit the question or answer with "Note that this code runs in python 2".

  • Edit the question or answer by providing comments in the code like

      a = raw_input("ask: ")  # use input("ask: ") for python3
    

In any case, do not change the code.

If the question and its answer are really specific to python 2, don't change anything, just make sure it has the python-2 tag.

When answering python questions, make them as compatible as possible with both versions. E.g. range(N) or print(head) will work in both versions (so the example in the question may acutally be one of the very rare cases where code may be changed - however best in consent with the posts author.); where necessary simply import from __future__. When using python 3, leave a comment in the line which might be different for python 2.

Remember: Python 2 is not dead (yet), it is still used more often than you might think, especially in productive, educational and scientific environments from where the highest demand for quick solutions on SO arises.

To simply put some numbers into play, here is a graph from a 2016 python-developers-survey:

enter image description here

In my opinion, you are not permitted to simply change the code that has been given in the context of Python 2 being around and most popular.

There is a huge danger of decoupling questions and answers and comments from each other by doing so.

I think there are several options:

  • Provide a new answer, title it with "Solution for Python 3".
  • Comment below the answer or question, saying that this code will only be working in Python 2, because of reason X.
  • Edit the question or answer with "Note that this code runs in Python 2".
  • Edit the question or answer by providing comments in the code like
a = raw_input("ask: ")  # use input("ask: ") for python3

In any case, do not change the code.

If the question and its answer are really specific to Python 2, don't change anything, just make sure it has the tag.

When answering Python questions, make them as compatible as possible with both versions. E.g. range(N) or print(head) will work in both versions (so the example in the question may acutally be one of the very rare cases where code may be changed - however best in consent with the posts author.); where necessary simply import from __future__. When using Python 3, leave a comment in the line which might be different for Python 2.

Remember: Python 2 is not dead (yet), it is still used more often than you might think, especially in productive, educational and scientific environments from where the highest demand for quick solutions on SO arises.

To simply put some numbers into play, here is a graph from a 2016 python-developers-survey:

enter image description here

added 254 characters in body
Source Link

In my opinion, you are not permitted to simply change the code that has been given in the context of python 2 being around and most popular.

There is a huge danger of decoupling questions and answers and comments from each other by doing so.

I think there are several options:

  • Provide a new answer, title it with "Solution for python 3".

  • Comment below the answer or question, saying that this code will only be working in python 2, because of reason X.

  • Edit the question or answer with "Note that this code runs in python 2".

  • Edit the question or answer by providing comments in the code like

      a = raw_input("ask: ")  # use input("ask: ") for python3
    

In any case, do not change the code.

If the question and its answer are really specific to python 2, don't change anything, just make sure it has the python-2 tag.

When answering python questions, make them as compatible as possible with both versions. E.g. range(N) or print(head) will work in both versions (so the example in the question may acutally be one of the very rare cases where code may be changed - however best in consent with the posts author.); where necessary simply import from __future__. When using python 3, leave a comment in the line which might be different for python 2.

Remember: Python 2 is not dead (yet), it is still used more often than you might think, especially in productive, educational and scientific environments from where the highest demand for quick solutions on SO arises.

To simply put some numbers into play, here is a graph from a 2016 python-developers-survey:

enter image description here

In my opinion, you are not permitted to simply change the code that has been given in the context of python 2 being around and most popular.

There is a huge danger of decoupling questions and answers and comments from each other by doing so.

I think there are several options:

  • Provide a new answer, title it with "Solution for python 3".

  • Comment below the answer or question, saying that this code will only be working in python 2, because of reason X.

  • Edit the question or answer with "Note that this code runs in python 2".

  • Edit the question or answer by providing comments in the code like

      a = raw_input("ask: ")  # use input("ask: ") for python3
    

In any case, do not change the code.

If the question and its answer are really specific to python 2, don't change anything, just make sure it has the python-2 tag.

When answering python questions, make them as compatible as possible with both versions. E.g. range(N) or print(head) will work in both versions (so the example in the question may acutally be one of the very rare cases where code may be changed - however best in consent with the posts author.); where necessary simply import from __future__. When using python 3, leave a comment in the line which might be different for python 2.

Remember: Python 2 is not dead (yet), it is still used more often than you might think, especially in productive, educational and scientific environments from where the highest demand for quick solutions on SO arises.

In my opinion, you are not permitted to simply change the code that has been given in the context of python 2 being around and most popular.

There is a huge danger of decoupling questions and answers and comments from each other by doing so.

I think there are several options:

  • Provide a new answer, title it with "Solution for python 3".

  • Comment below the answer or question, saying that this code will only be working in python 2, because of reason X.

  • Edit the question or answer with "Note that this code runs in python 2".

  • Edit the question or answer by providing comments in the code like

      a = raw_input("ask: ")  # use input("ask: ") for python3
    

In any case, do not change the code.

If the question and its answer are really specific to python 2, don't change anything, just make sure it has the python-2 tag.

When answering python questions, make them as compatible as possible with both versions. E.g. range(N) or print(head) will work in both versions (so the example in the question may acutally be one of the very rare cases where code may be changed - however best in consent with the posts author.); where necessary simply import from __future__. When using python 3, leave a comment in the line which might be different for python 2.

Remember: Python 2 is not dead (yet), it is still used more often than you might think, especially in productive, educational and scientific environments from where the highest demand for quick solutions on SO arises.

To simply put some numbers into play, here is a graph from a 2016 python-developers-survey:

enter image description here

added 49 characters in body
Source Link

In my opinion, you are not permitted to simply change the code that has been given in the context of python 2 being around and most popular.

There is a huge danger of decoupling questions and answers and comentscomments from each other by doing so.

I think there are several options:

  • Provide a new answer, title it with "Solution for python 3".

  • Comment below the answer or question, saying that this code will only be working in python 2, because of reason X.

  • Edit the question or answer with "Note that this code runs in python 2".

  • Edit the question or answer by providing comments in the code like

      a = raw_input("ask: ")  # use input("ask: ") for python3
    

In any case, do not change the code.

If the question and its answer are really specific to python 2, don't change anything, just make sure it has the python-2 tag.

When answering python questions, make them as compatible as possible with both versions. E.g. range(N) or print(head) will work in both versions (so the example in the question may acutally be one of the very rare cases where code may be changed - however best in consent with the posts author.); where necessary simply import from __future__. When using python 3, leave a comment in the line which might be different for python 2.

Remember: Python 2 is not dead (yet), it is still used more often than you might think, especially in productive, educational and scientific environments from where the highest demand for quick solutions on SO arises.

In my opinion, you are not permitted to simply change the code that has been given in the context of python 2 being around and most popular.

There is a huge danger of decoupling questions and answers and coments from each other by doing so.

I think there are several options:

  • Provide a new answer, title it with "Solution for python 3".

  • Comment below the answer or question, saying that this code will only be working in python 2, because of reason X.

  • Edit the question or answer with "Note that this code runs in python 2".

  • Edit the question or answer by providing comments in the code like

      a = raw_input("ask: ")  # use input("ask: ") for python3
    

If the question and its answer are really specific to python 2, don't change anything, just make sure it has the python-2 tag.

When answering python questions, make them as compatible as possible with both versions. E.g. range(N) or print(head) will work in both versions (so the example in the question may acutally one of the rare cases where code may be changed - however best in consent with the posts author.); where necessary simply import from __future__. When using python 3, leave a comment in the line which might be different for python 2.

Remember: Python 2 is not dead (yet), it is still used more often than you might think, especially in productive, educational and scientific environments from where the highest demand for quick solutions on SO arises.

In my opinion, you are not permitted to simply change the code that has been given in the context of python 2 being around and most popular.

There is a huge danger of decoupling questions and answers and comments from each other by doing so.

I think there are several options:

  • Provide a new answer, title it with "Solution for python 3".

  • Comment below the answer or question, saying that this code will only be working in python 2, because of reason X.

  • Edit the question or answer with "Note that this code runs in python 2".

  • Edit the question or answer by providing comments in the code like

      a = raw_input("ask: ")  # use input("ask: ") for python3
    

In any case, do not change the code.

If the question and its answer are really specific to python 2, don't change anything, just make sure it has the python-2 tag.

When answering python questions, make them as compatible as possible with both versions. E.g. range(N) or print(head) will work in both versions (so the example in the question may acutally be one of the very rare cases where code may be changed - however best in consent with the posts author.); where necessary simply import from __future__. When using python 3, leave a comment in the line which might be different for python 2.

Remember: Python 2 is not dead (yet), it is still used more often than you might think, especially in productive, educational and scientific environments from where the highest demand for quick solutions on SO arises.

Source Link
Loading