CSC108H1 Study Guide - Final Guide: Docstring, Precondition, Standard Streams

32 views20 pages
yifanyang and 39659 others unlocked
CSC108H1 Full Course Notes
21
CSC108H1 Full Course Notes
Verified Note
21 documents

Document Summary

Do not turn this page until you have received the signal to start. In the meantime, please read the instructions below carefully. This nal examination paper consists of 8 questions on 20 pages (including this one). When you receive the signal to start, please make sure that your copy of the nal examination is complete. Comments and docstrings are not required except where indicated, although they may help us mark your answers. They may also get you part marks if you can"t gure out how to write the code. You may not use break or continue on this exam. If you use any space for rough work, indicate clearly what you want marked. """ (number) -> number print("line a:", x) x = x * x print("line b:", x) return x if __name__ == "__main__": x = 5 print("line c:", x) square(x) print("line d:", x) square(x + 1) print("line e:", x)