SHARE
TWEET

Untitled

a guest Aug 19th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Pair:
  2.     def __init__(self, first, second):
  3.         if isinstance(first, float) and isinstance(second, int):
  4.             self.first = first
  5.             self.second = second
  6.         else:
  7.             raise TypeError
  8.  
  9.     def power(self):
  10.         self.data = (self.first ** self.second)
  11.  
  12.     def display(self):
  13.         print(self.data)
  14.  
  15.  
  16. def make_pair():
  17.     val1 = input()
  18.     val2 = input()
  19.     return Pair(val1, val2)
  20.  
  21.  
  22.  
  23. test1 = make_pair()
  24.  
  25. test1.power()
  26. test1.display()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top