2

When I write print("Hello", "world") the output should be Hello world, however what I am getting is ('Hello', 'world') I understand that this has something to do with the Python version, where in python 2 the print function did not require parentheses.

I have tried changing the python version and it is displayed as python 3.10.0, I have tried using a custom path as well as looking in other forums but can't seem to find a solution.

2
  • 1
    What's the result of print(sys.executable)? How can you confirm you have selected the python3.10? where have you got it? Commented Nov 4, 2021 at 1:44
  • I solved the problem since so if you are here to help thanks but I managed to switch versions in the end. If you have this problem yourself then here is how I did it: stackoverflow.com/questions/69833055/… Commented Nov 4, 2021 at 19:16

1 Answer 1

1

This is because, as you said, you use an old version of Python. To find a solution, try with:

print("Hello " + "world")

The output will be:

>>> Hello world
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.