-
PSAD review on 1.13카테고리 없음 2017. 5. 2. 13:01
While I was studying PSAD, I found some interesting python features and would like to give some feedback.
1. Python has //, even tough it doesn't have ++
Interestingly, Python has '//' operator. What it does is returning the division value flooring the fraction.
Please check http://stackoverflow.com/questions/183853/in-python-2-what-is-the-difference-between-and-when-used-for-division
On the other hand, ** is exponential in Python.
2. If your code line gets too long, you can separate it into 2 lines
In Python code line, you can put '\' at the end of the line to separate a long line into two or more shorter lines.
3. Review on Self Check Video
In this video, I could see the test results are ok but I found some bugs in the codes while being written.
1) After copying and pasting "__eq__" functions twice for "__lt__" and "__gt__", the lecturer did not change "__eq__" to "__gt__" function.
2) In "__truediv__" function, at the end line, '/' is used for dividing 'newden' by 'common' not '//'.
Anyway, it seems a luck to see the test results in the video ok.