Class 26 — March 23
Practice makes perfect — Is more than a platitude — Take it to your heart
Look both ways
Final exam
- May 3 at 7 PM
Test 2
- TBD - April 7 or 9th. Likely the 7th.
Module primal
Module take_two
- Code: take_two.py
- Function
signum( x )
- Function parameter
x
is a numeric value. The function returns integer -1, 0, or 1 depending respectively whetherx
is negative, zero, or positive. The function does not print any output.
- Function
mid( s )
- If the length of string
s
is odd, the function returns the middle character ofs;
otherwise, the function returns the two middle characters ofs
. The function does not print any output.
- Tester: taken.py
Warning: fopen(/l/cs1112/public_html/defs/htm/181-trailer): Failed to open stream: No such file or directory in /l/cs1112/public_html/defs/php/read.php on line 5
Unable to open file!