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¶
- Website for programming practice (free and non-commercial)
- Let's check out a problem:
- See also: codewars, leetcode, hackerrank (for-profit)
CodingBat Lab¶
- Go to the CodingBat website: https://codingbat.com/python
- Create/login with an account (use your @dukes email) to save your results (important)!
-
Complete (at least) the following problems (2pts each):
-
Required: At the end of class, go to https://codingbat.com/pref and use the Teacher Share option to send your responses to spragunr@jmu.edu . Enter your name as a memo.