Skip to content

Monday 9/18

Upcoming Events

  • TONIGHT: CS/IT First Year Kick-off: Monday, Sep. 18th from 5pm-6pm in King 159

Main Blocks

Instead of this:

def some_cool_function(arg1):
    return 20 + arg1

# Test it out...
ans = some_cool_function(30)
print(ans)

We typically prefer this:

def some_cool_function(arg1):
    return 20 + arg1

if __name__ == "__main__":
    # Code inside this block runs when the file is executed, but NOT
    # when it is imported.

    # Test it out...
    ans = some_cool_function(30)
    print(ans)

CodingBat

CodingBat Lab