Sep-14-2024, 01:02 PM
(This post was last modified: Sep-14-2024, 01:02 PM by deanhystad.)
Are you running this as a script, or typing it directly into the python interpreter? It works fine when run as a script.
If you are typing in the python interpreter you need to enter the message after the input statement and before the print statement. Like this.
If you are typing in the python interpreter you need to enter the message after the input statement and before the print statement. Like this.
Output:> python
Python 3.11.1 (tags/v3.11.1:a7a450f, Dec 6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> message = input("Tell me something, and I will repeat it back to you: ")
Tell me something, and I will repeat it back to you: this is the message
>>> print(message)
this is the message
>>>