Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from time import perf_counter
- from scipy import root_scalar
- def printMainMenu(maxIter, tol, partitions):
- print('''
- Меню:
- 1 - Поиск корней
- 2 - Изменить максимальное число итераций (установлено {:d})
- 3 - Изменить значение точности (установлено {:e})
- 4 - Изменить число разбиений отрезка (установлено {:d})
- 0 - Выход
- '''.format(maxIter, tol, partitions))
- def rootSearch():
- pass
- def main():
- maxIter = 100
- tol = 0.001
- partitions = 10
- choice = None
- while choice != '0':
- printMainMenu(maxIter, tol, partititon)
- choice = input("Ваш выбор: "); print()
- if choice == '1':
- rootSearch()
- elif choice == '2':
- maxIter = int(input("Введите новое максимальное число итераций: "))
- elif choice == '3':
- tol = float(input("Введите новое значение точности: "))
- elif choice == '4':
- pastitions = int(input("Введите новое число разбиений отрезка: "))
- elif choice == '0':
- print("Выход")
- else:
- print("Неизвестная команда")
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement