Update task.py

Streamlined and eliminated error when entering a task number that does not exist.