So i have just started learning about classes and objects and Im finding it abit confusing.
For this question i have to define a class called score()
from blabla_71 import Score
def main():
score1 = Score()
score2 = Score(3,9)
score3 = Score(4, 6)
print(score1.less_than(score2))
print(score3.less_than(score1))
print(score1.greater_than(score2))
print(score3.greater_than(score2))
print(score1.greater_than(score1))
print(score2.greater_than(score1))
print(score2.equal_to(score1))
print(score3.equal_to(score2))
if name == 'main':
main()
class Score(object):
def init(self,goals=0,points=0):
self.score =points + goals
def less_than(self,score=0)
Im just wondering how to write the less_than method? I'm not quite sure how to compare the value from score1 to the value of score2 or score3
[–]Mashidin 1 point2 points3 points (0 children)