CSC148H1 Lecture Notes - Lecture 1: Docstring, Init
katrinasavvy and 38715 others unlocked
1
CSC148H1 Full Course Notes
Verified Note
1 document
Document Summary
The first 30 min the professor talked about the course and discussed the syllabus with the class. If two objects are the same they should have the same address if address does not appear to be the same, we know we have a different object. Everything in python is a class, (i. e. databases) However, if you want to create a different attribute. Index is a method or object under the class. When we create a class we need to think whether we want to create a variable or not. Implement the class: body of special methods _ init_,_eq_,and _str, body of other methods, testing (more on this time) Although python as a build-in type for floating point numbers, there is no built in type for representing rational numbers: Rational numbers are rations of two integers/q. where p is called the numerator and q is called the denominator. Operations on rational fractions include addition, multiplication and comparison.