Toggle navigation shitcode
  • Latest
  • Browse
  • Top
  • Worst
  • Add
  • All 495
  • ActionScript 3
  • Bash 7
  • Brainfuck 1
  • LSL 21
  • C++ 35
  • C# 54
  • CSS 5
  • Pascal 1
  • Django 1
  • Erlang 1
  • GLSL 1
  • Go 7
  • Groovy 1
  • HTML 10
  • Java 76
  • JavaScript 104
  • Less 1
  • Lua 3
  • Nix 1
  • Obj-C 4
  • OCaml 1
  • Perl 1
  • PHP 74
  • PowerShell 1
  • Python 46
  • Ruby 3
  • Rust 2
  • Scala 3
  • SQL 7
  • Swift 4
  • TypeScript 13
  • VBScript 2
  • Verilog 1
#105 How to get the absolute value on just 6 lines of python Python +203
def absolute_value(value):
    if str(value)[0]=='-':
        value = -1 * value
        return value
    else:
        return value
Comments
By Random student of algorithms., 2017-12-12 04:32:36
  • «
  • 1
  • 2
  • 3
  • 4
  • »

© Shitcode.net 2025, Powered by Yii Framework

GitHub • About • Admin