Made it a one liner. Added try-except

Cleaned up the code a bit. Also added a try-except statement to make sure the the input which is being sqrt'ed is a number.
Merge pull request #2 from vorfin/patch-2

Cleaned up the code a bit. Added try-except