CSC148H1 Lecture : jan25c.docx
katrinasavvy and 38715 others unlocked
1
CSC148H1 Full Course Notes
Verified Note
1 document
Document Summary
Expected " : + str(expect) + ". ", expect = expect - 1, def empty_suite(), return unittest. testloader(). loadtestsfromtestcase(stackemptytestcase, def all_suite(), return unittest. testloader(). loadtestsfromtestcase(stackalltestcase, if __name__ == "__main__", runner = unittest. texttestrunner(, runner. run(empty_suite(), runner. run(all_suite()) >>> in e 3: g"s i variable is different from f"s i variable, def h(i), print in g", i, if i < 3, h(i + 1, output: in h 1 in h 2 in h 3. Globals() shows the dictionary with all the names stored and builtins. Locals() same as globals() in module, in functions it change. Write a fib function to calculate the fibonnaci numbers: fib(0) = 1, fib(1) = 1, fib(n) = fib(n-1) + fib(n 2, 1, 1, 2, 3, 4, 8, 13. Recursive minimum function: reduces the list by 1 item each time until its 1 item, returns it, compares it w/ the first item of the 2 items list one level higher.