Top Stories published by New Light Technologies, Inc. (NLT in 2021
January
June
July
August
September
October
December

Beyond assert

Last time, we built a factorial function in a test-driven style using Python’s assert statement:

def factorial(n):
if n < 0:
raise ValueError('Factorial of negative is undefined')
return n * factorial(n-1) if n else 1

Basic Negative Testing

In part one, we started writing a factorial function in the test-driven style. We depend on the humble “assert” statement to run our tests and we ended with this:

def factorial(n):
return n * factorial(n-1) if n else 1

These were the top 10 stories published by New Light Technologies, Inc. (NLT in 2021. You can also dive into monthly archives for 2021 by using the calendar at the top of this page.

About
New Light Technologies, Inc. (NLT
New Light Technologies (NLT) provides enterprise information solutions that combine Information Technology (IT) ingenuity and industry intelligence to drive high-performance results for our clients. We help commercial companies and governments at the federal, state, and local
More information
Tags
Editors