Created
February 1, 2016 12:36
-
-
Save Sinitca-Aleksandr/18a2fee586905bcdcc10 to your computer and use it in GitHub Desktop.
Простой пример работы с обыкновенными дробями
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Импорт библиотеки sympy | |
| >>> from sympy import * | |
| # Определяем переменную a, как дробь 1/3 | |
| >>> a = Rational(1,3) | |
| # Выведем a и проделаем некоторые математические действия | |
| >>> a | |
| 1/3 | |
| >>> a*3 | |
| 1 | |
| >>> a*a | |
| 1/9 | |
| >>> Rational(3,5)**50 | |
| 717897987691852588770249/88817841970012523233890533447265625 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment