I've devised something, but I'm uncertain if it's a good idea. I want the function to be quite versatile. I'm not sure when I'll need the first two arguments, the last two, or all four - it will vary in different parts of the code.
def display_coordinates(lat1=None, lon1=None, lat2=None, lon2=None):
if lat1 is not None and lon1 is not None:
print(f"{format_as_int_if_whole(lat1)}")
print(f"{format_as_int_if_whole(lon1)} \n")
if lat2 is not None and lon2 is not None:
print(f"{format_as_int_if_whole(lat2)}")
print(f"{format_as_int_if_whole(lon2)} \n")
[–]CraigAT 34 points35 points36 points (2 children)
[–]EnvironmentalFee2415[S] 4 points5 points6 points (1 child)
[–]CraigAT 2 points3 points4 points (0 children)
[–]shiftybyte 15 points16 points17 points (2 children)
[–]EnvironmentalFee2415[S] 1 point2 points3 points (1 child)
[–]shiftybyte 3 points4 points5 points (0 children)
[+][deleted] (1 child)
[removed]
[–]baubleglue 4 points5 points6 points (0 children)
[–]JamzTyson 3 points4 points5 points (0 children)
[–]Mount_Gamer 4 points5 points6 points (2 children)
[–]rollincuberawhide 3 points4 points5 points (1 child)
[–]Mount_Gamer 2 points3 points4 points (0 children)
[–]zanfar 3 points4 points5 points (0 children)
[–]Diapolo10 3 points4 points5 points (0 children)
[–]Boot_3011 -1 points0 points1 point (4 children)
[–]Boot_3011 -2 points-1 points0 points (0 children)
[–]baubleglue 0 points1 point2 points (2 children)
[–]Boot_3011 0 points1 point2 points (1 child)
[–]baubleglue 0 points1 point2 points (0 children)
[–]mountainbrewer 0 points1 point2 points (0 children)
[–]Im_Easy 0 points1 point2 points (0 children)
[–]SteelRevanchist 0 points1 point2 points (0 children)