Here is the corresponding Python code. Use your text editor to create
the source program. Call the file
Copy the following lines.
chmod +x whoyou.py whoyou.py
You should be prompted for your name and age. In each case after typing your response on a single line, you must hit the Enter key to proceed.
It is a good idea to become familiar with Python error messages, so
after the script succeeds, try deliberately to make it fail by
changing the second
age on the last line to
rerun your program. You should see an error message that tells you
the line number where the error occurred, prints the offending line,
and explains that the name
ago is not defined.
Try running the program, but enter your last name when it asks for your age. What happens?