Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Python
def square(x):
    return x**2

You can use power operator
square = lambda x: x * x
def square(x):
    return x*x

You don't have to explicitly write the return type
function Square (X : Integer) return Integer is
begin
   return X * X;
end Square;

New implementation...
< >
programming-idioms.org