Basic-Python-Programs icon indicating copy to clipboard operation
Basic-Python-Programs copied to clipboard

Add distance_calculator

Open Mathdallas-code opened this issue 11 months ago • 3 comments

I'd like to add a distance calculation program i made

Mathdallas-code avatar Jan 11 '25 13:01 Mathdallas-code

@souravjain540 please review

Mathdallas-code avatar Jan 11 '25 14:01 Mathdallas-code

The code works for positive integers but doesn't accept negative points (ex: (-2,0)). In addition, there should be a way to break out of the while loop, such as inputting a sentinel value.

Ok I will try to fix it, and thanks for telling 👍

Edit: I fixed the bug and it was actually really easy. I just replaced every .isdigit() with .isalpha()

Mathdallas-code avatar Jan 15 '25 10:01 Mathdallas-code

Looks good!

Thanks! I also fixed a bug where decimal numbers were incompatible.

Mathdallas-code avatar Jan 16 '25 06:01 Mathdallas-code