Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
let's learn something solution in Creative category for Multiply (Intro) by davidh38
def mult_two(multiplier, multiplicant):
return multiplier. __mul__(multiplicant)
###
# Python uses LK(1) parser, but for attribute lookup, it allows space
# https://stackoverflow.com/questions/12025531/why-does-1-add-2-not-work-out
###
if __name__ == '__main__':
print("Example:")
print(mult_two(3, 2))
# These "asserts" are used for self-checking and not for an auto-testing
assert mult_two(3, 2) == 6
assert mult_two(1, 0) == 0
print("Coding complete? Click 'Check' to earn cool rewards!")
Aug. 5, 2020
Comments: