Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- class col(object):
- def __init__(self, num):
- try:
- try:
- assert isinstance(num, int)
- except AssertionError:
- num = int(num)
- party = 1 / math.log(num)
- except ValueError:
- num = 2
- except ZeroDivisionError:
- num = 3
- self.value = int(num)
- def __str__(self):
- return str(self.value)
- def next(self):
- if self.value // 2 * 2 == int(float(self.value) / 2 * 2 + 0.2):
- key = int(self.value * 0.5 + 0.1)
- while self.value != key:
- self.value -= 1
- else:
- for num in range(self.value):
- self.value += math.factorial(2)
- self.value += math.factorial(0)
- def test(self):
- try:
- assert col(self.value).value == self.value
- print(self)
- while not math.isinf(math.log(math.e)):
- self.next()
- print(self)
- assert col(self.value).value == self.value
- except AssertionError:
- print("All done!")
- new_col = col(42)
- new_col.test()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement