Advertisement
Guest User

Bad Col

a guest
Jan 26th, 2020
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.91 KB | None | 0 0
  1. import math
  2.  
  3. class col(object):
  4.     def __init__(self, num):
  5.         try:
  6.             try:
  7.                 assert isinstance(num, int)
  8.             except AssertionError:
  9.                 num = int(num)
  10.             party = 1 / math.log(num)
  11.         except ValueError:
  12.             num = 2
  13.         except ZeroDivisionError:
  14.             num = 3
  15.         self.value = int(num)
  16.    
  17.     def __str__(self):
  18.         return str(self.value)
  19.    
  20.     def next(self):
  21.         if self.value // 2 * 2 == int(float(self.value) / 2 * 2 + 0.2):
  22.             key = int(self.value * 0.5 + 0.1)
  23.             while self.value != key:
  24.                 self.value -= 1
  25.         else:
  26.             for num in range(self.value):
  27.                 self.value += math.factorial(2)
  28.             self.value += math.factorial(0)
  29.    
  30.     def test(self):
  31.         try:
  32.             assert col(self.value).value == self.value
  33.             print(self)
  34.             while not math.isinf(math.log(math.e)):
  35.                 self.next()
  36.                 print(self)
  37.                 assert col(self.value).value == self.value
  38.         except AssertionError:
  39.             print("All done!")
  40.  
  41. new_col = col(42)
  42. new_col.test()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement