Is it acceptable to have an import line in the python file?
Date: 23 Nov 2012 18:05
Number of posts: 3
RSS: New posts
Yes, Pavel. This is acceptable, and you have seen cases like that in the lecture and recitations.
If you mean to ask if that is acceptable in the homework as well - then the answer is yes (as long as you are not using something that is somehow prohibited to use).
BTW, there's a module named fractions in python (import fractions), which gives the functionality of rational numbers.
Obviously, using it is NOT allowed, since it makes this whole exercise totally trivial.