[WikiItic] [TitleIndex] [WordIndex

1. Hèrencia

1.1. Exercici 6.1

   1 class Equacio2g(object):
   2     def __init__(self, a, b, c):
   3         self.a=a
   4         self.b=b
   5         self.c=c
   6         
   7     def v_eq(self, x):
   8         return ((x**2)*self.a)+(x*self.b)+self.c
   9 
  10     def __eq__(self, v):
  11         ra=self.a/v.a
  12         rb=self.b/v.b
  13         rc=self.c/v.c
  14         if ra == rb and ra == rc:
  15             return True
  16 
  17     def __ne__(self, v):
  18         return not self == v

2023-07-03 11:46