Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- class LogExp:
- definicja = 'log(x, y) - Zwraca logarytm z X o podstawie "y" ale jeżeli nie ma podstawy to bedzie logarytm o podstawie (y) 10.'
- def __init__(self, a):
- self.a = a
- while self.a < 0:
- self.a = int(input('podaj dodatnia podstawe'))
- def defi(self, x):
- print(self.definicja)
- print(math.log(x, self.a))
- def main():
- a = int(input('Podaj konstruktor(podstawe logarytmu): '))
- newLogExp = LogExp(a)
- x = int(input('Podaj liczbę, którą chcesz zlogarytmować: '))
- newLogExp.defi(x)
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement