Main.Divisibility History
Hide minor edits - Show changes to markup
February 02, 2010, at 01:30 PM MST
by -
Added lines 1-19:
(:source lang=python:)
"""Example showing how functions that return a boolean value can be written very concisely"""
def is_divisible(x, y) :
"""determines if x is divisible by y"""
if x % y == 0:
return True
else:
return False
- a more concise way of writing this function:
def is_divisible_concise(x, y) :
"""determines if x is divisible by y"""
return x % y == 0:
(:sourceend:)
