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
| interstitial.setAdListener(new AdListener() { | |
| @Override | |
| public void onAdLoaded() { | |
| super.onAdLoaded(); | |
| displayInterstitial(); // Запустить показ рекламы | |
| } | |
| }); |
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
| s = "Hello World" | |
| print(s) | |
| print("Hello world") |
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
| # Вывод текстовой строки | |
| print("Hello World") | |
| # Для вывода нескольких строк можно использовать спецсимвол \n | |
| print("First Line\nSecond Line") | |
| # Вывод переменных | |
| x = 5 | |
| print(x) |
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
| # Для ввода текстовой строки | |
| name = input("Enter a name: ") | |
| # Для ввода целого значения | |
| x = int(input("What is x? ")) | |
| # Для ввода десятичных дробей | |
| x = float(input("Write a number")) |
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
| x = int(input("Print 4=")) | |
| if x == 4: | |
| print("Thank you") |
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
| # Целочисленная переменная | |
| x = 2 | |
| # Десятичная дробь | |
| price = 2.5 | |
| # Строка или символ | |
| word = 'Hello' | |
| char = "s" |
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
| type1 = "word" # word | |
| type2 = 'word' # word | |
| type3 = '''word''' # word |
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 |
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
| >>> from sympy import * | |
| # Объявляем символьные переменные | |
| >>> x = Symbol('x') | |
| >>> y = Symbol('y') | |
| # Теперь можно работать с символьными выражениями | |
| >>> x+x+x+y | |
| 3*x + y | |
| >>> x*x*y+x |
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
| >>> from sympy import * | |
| # Разложим на простейшие | |
| >>> apart(1/( (x+3)*(x+6) ), x) | |
| -1/(3*(x + 6)) + 1/(3*(x + 3)) | |
| >>> apart((2*x+1)/(x-1), x) | |
| 2 + 3/(x - 1) | |
| # Перемножим дроби |