# Appendix A

## Print Python Version

{% code lineNumbers="true" %}

```python
import sys  # Import the sys module to access system-specific parameters and functions

# Print the Python version to the console
print("Python version")

# Use the sys.version attribute to get the Python version and print it
print(sys.version)

# Print information about the Python version
print("Version info.")

# Use the sys.version_info attribute to get detailed version information and print it
print(sys.version_info)
```

{% endcode %}

Save the file as `Ver.py`, then execute the program using the command below:

```
$ python Ver.py
```

And the output will look like this:

```
Python version
3.12.1 (main, Dec  8 2023, 18:57:37) [Clang 14.0.3 (clang-1403.0.22.14.1)]
Version info.
sys.version_info(major=3, minor=12, micro=1, releaselevel='final', serial=0)
```
