Skip to content

Instantly share code, notes, and snippets.

@janash
Created September 6, 2021 18:16
Show Gist options
  • Save janash/20805fb0f04f8341a87c0ab1f7fedc68 to your computer and use it in GitHub Desktop.
Save janash/20805fb0f04f8341a87c0ab1f7fedc68 to your computer and use it in GitHub Desktop.
r = abs(5)
def abs(values):
"""Extend abs function to work on lists"""
import builtins
if type(values) == list:
for i in range(len(values)):
values[i] = builtins.abs(values[i])
else:
values = builtins.abs(values)
return values
t = abs(5)
print(builtins.abs(5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment