Advertisement
Guest User

Untitled

a guest
Nov 1st, 2021
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. class MojaKlasa:
  2.    
  3.     def __init__(self, a):
  4.         self.a = a
  5.        
  6.     def potega(self):
  7.         wynik = self.a ** 2
  8.        
  9.         return wynik
  10.        
  11. b = MojaKlasa(2)
  12.  
  13. c = b.potega()
  14.  
  15. print(c)
  16.  
  17. ##############################################
  18.  
  19. class MojaKlasa:
  20.    
  21.     def __init__(self, a):
  22.         self.a = a
  23.        
  24.     def potega(self):
  25.         self.wynik = self.a ** 2
  26.        
  27. b = MojaKlasa(2)
  28.  
  29. b.potega()
  30.  
  31. print(b.wynik)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement