Advertisement
Guest User

Untitled

a guest
Apr 9th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. class wspolczynniki:
  2. def __init__(self, list1=[], list2=[]):
  3. self.list1 = list1
  4. self.list2 = list2
  5. nowosc = wyznaczniki()
  6.  
  7. class wyznaczniki:
  8. def __init__(self):
  9. print("Hello")
  10.  
  11. def countWyznaczniki(self):
  12. self.w = self.list1[0]*self.list2[1] - self.list1[1] * self.list2[0]
  13. self.wX = self.list1[2] * self.list2[1] - self.list1[1] * self.list2[2]
  14. self.wY = self.list1[0] * self.list2[2] - self.list1[2] * self.list2[0]
  15. return self.wyznaczniki(self.w, self.wX, self.wY)
  16.  
  17.  
  18. def mistake():
  19. print("Proszę o wprowadzenie nie współczynników nie zerowych")
  20. getWspolczynniki()
  21.  
  22. def getWspolczynniki():
  23. row1 = [int(input(f"Proszę o wprowadzenie wspolczynnika o numerze {x+1} do rownania pierwszego\n")) for x in range (0, 3) ]
  24. row2 = [int(input(f"Proszę o wprowadzenie wspolczynnika o numerze {x+1} do rownania drugiego\n")) for x in range (0, 3) ]
  25. for i in row1:
  26. if i==0:
  27. return mistake()
  28. for i in row2:
  29. if i==0:
  30. return mistake()
  31. return wspolczynniki(row1, row2)
  32.  
  33. rownania = getWspolczynniki()
  34. print(rownania.list1)
  35. print(rownania.list2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement