Skip to main content
1 of 7
Justin
  • 21.3k
  • 9
  • 67
  • 114

#Python - 31

Uses a generator function to save 1 char, so it is necessary to print the value with some function that uses a generator/iterator, like for i in a(b):print i

def a(b):yield b if b>0 else-b
Justin
  • 21.3k
  • 9
  • 67
  • 114