The tab mapper is a handy little tool that will render a guitar tab file with graphic chord diagrams displayed alongside. This comes in handy for people who just don't have every single chord shape memorized. Just plug in the web site address of a valid .tab or .crd file and hit "Go". In general, the tab mapper does a better job with printer friendly URLs. If there is more than one way to play a chord, the tab mapper will choose the most common shape. To see other fingerings, click on the chord diagram and you will be taken to the chord calculator.
Original file located @ https://lajfhak.ru-land.com/stati/python-nastroyka-pod-svoy-proekt-v-linux-prostoy-sposob.
Show me scales that sound good with the chords in this song: C.
Ubuntu 20.04 ? ?????? ?????? Debian Linux ???????????? ? ?????????????????3. ????? ?????????, ??? ???? ?????? ?????????, ???????? ????????? ?????? ???????:
????? ???????? ??????, ????????????? ? ????? ???????, ????? ?????????, ??? ? ??? ??????????? ????????? ??????:
????-y??????????, ??? ?? ???????? ?? ????????? ???? ?????????, ?? ? ??????????? ?? ????? ?????? Linux ??? ????? ????????????? ????????????? ?????????????? ???????? ?? ???? ?????????? ????? ???????.
????? ?????????? ???????? ?? ????? ????????? ??????3, ????????????? ? ???????, ??????:
?? ???????? ????? ? ???? ?????????, ??????? ??????? ??? ????? ??????. ???? ??? ????? ????? ?????????????, ????? ????? ???????? ?????:
Output
Python3.8.10????? ????????? ???????????? ???????? ??? Python, ??????? ????????? pip, ??????????, ??????? ????? ????????????? ? ????????? ???????????? ????????, ??????? ?? ????? ???????? ???????????? ? ????? ???????? ??????????. ?? ?????? ?????? ?????? ? ??????? ??? ???????, ??????? ????? ?????????? ? ??????? pip, ???????? How To Import Modules in3.
??????????? ??????????, ??????:
?????package_name????? ?????????? ? ?????? ?????? ??? ?????????? Python, ???????? Django ??? ???-?????????? ??? NumPy ??? ??????? ??????????. ???????, ???? ?? ?????? ?????????? NumPy, ?? ?????? ??????? ??? ? ??????? ???????pip3 install numpy.
???? ??? ????????? ??????? ? ???????????? ??????????, ??????? ????? ??????????, ????? ?????????, ??? ? ??? ???? ???????? ????????? ??? ????? ????? ????????????????:
????? ?????????? ????????? pip ? ?????? ???????????? ?? ????? ????????? ??????????? ????? ??? ????? ???????? ??????????.
?????: ????? ?????????? Python ? Linux, ??? ????? ??????? ???????? ? ?????? ??????? "sudo apt-get install python3", ????? ???? ??????? ????????????? ??????? ? ????????? Python. ???? ?? ??????????? ?????? ??????????? Linux, ?? ??????? ????? ??????????. ????????, ??? Fedora ?? ?????? ???????????? ??????? "sudo dnf install python3".
?????: ????? ?????????, ??? Python ??????????, ?? ?????? ??????? ???????? ? ?????? ??????? "python3 --version". ???? Python ??????????, ?? ??????? ??????? ?????? Python. ???? ?? ??????? ????????? ?? ??????, ?????? Python ?? ??????????.
?????: ????? ??????? ????? ?????? ? Python, ??? ????? ??????? ????? ??? ??????? ? ??????? ?? ? ????????? ?????????. ????? ?? ?????? ??????? ???? ? ??????????? .py, ? ??????? ?? ?????? ???????? ??? ?? Python. ????????, ?? ?????? ??????? ???? "main.py" ? ?????? ?????? ???.
?????: ????? ????????? ?????? ? Python, ??? ????? ??????? ????????, ??????? ? ????? ??????? ? ?????? ??????? "python3 main.py", ??? "main.py" - ??? ??? ?????? ????? ? ????? ?? Python. ???? ??? ?????? ???????, ?? ??????? ??????? ????????? ?????????? ????.
?????: ????? ???????? ?????????? ? ??????, ??? ????? ?????????? ?????????? ? ??????? pip. ??? ????? ?? ?????? ??????? ????????, ??????? ? ????? ??????? ? ?????? ??????? "pip3 install ??????????_???", ??? "??????????\_???" - ??? ??? ??????????, ??????? ?? ?????? ??????????. ????? ????????? ?????????? ?? ?????? ?? ???????????? ? ????? ???????.
?????: ????? ????????? ????????? ?????????? ? Python, ??? ????? ?????????? ??????????????? ????? ?????????? (IDE), ????? ??? PyCharm ??? Visual Studio Code. ????? ????????? IDE ?? ?????? ??????? ????? ??????, ???????? ????? ? ??????????, ????????? ?????????????? ???? ? ?????? ??????.
?????: ????? ????????? ??????? ???? ? Python, ??? ????? ???????????? ??????????????? ????? ?????????? (IDE), ????? ??? PyCharm ??? Visual Studio Code. ? IDE ?? ?????? ????????? ????? ????????, ??????????? ???????? ??????????, ????????? ?????????? ???? ? ?????? ??????.
?????: ????? ????????? ?????????????? ???????????? ???? ? Python, ??? ????? ?????????? ?????????? ??? ????????????, ????? ??? pytest ??? unittest. ????? ????????? ?????????? ?? ?????? ???????? ????? ??? ?????? ???? ? ????????? ?? ? ??????? ??????? "pytest" ??? "python -m unittest". ???? ??? ????? ??????? ???????, ?? ??????? ??????? ????????? ?? ??????.
Data Science ? ???????? ????????. ??? ??? ??????????? IT ????? ??????? ???? ? ??????. ????? ? ?????? ??????????? ? ????????? ??????? ???????? ?????????? ?? ???? ?????? , ? ???????? ???????? ? ? ?????????? ???????????? ??????????, ????????? ??????? ?? ??? ? ?????? ?????? ????????. ? Data Science ?????????? Python ??? ????????? ??????? ? ???????? ??????, ?????? ? ????????? ?????????????? ??????????, ?? ???????????? ? ???? ????????, ???????? ? ?.?. ? ??????? ?????????? Python ML ???????????????? ???????????, ??????, ????????? ??????, ?????????????? ????????????? ??? ? ????, ????????? ???????? ????????.
IT-???????
?????????? ?????????????????? ??????
???????? ???? ? ?????????? ???? ??????????? ? IT. ??????????? ?????, ????????? ??????? ? ?????? ???? ???????? ????? ?????????? ????? ? ????????? ????????????
??????????? ?????????
IT-??????????-??????????. ?????? ??????? ????????-????????, ????? ??? Google, Facebook*, ????????????? ?? Python ???? ????? ????????? ???????, ????????, Instagram*, YouTube, Dropbox ? ?.?. ???? ???? ????????? ????? ???-?????????? ?? ??????? ???????, ?????? ??? ??? ???????? ?????????? ???????? ????????? ??????? ??? ??? ??? ?????????? ??????? ????????? ???????. ?? ???? ????? ???????? ????????????? Python ?????? ??????????? ?????????? ????????? ? ?????????? ?????????????? ??? ???????? ??????, ?????????? ? ????????? ???-??????????.
?????????? ? ???????????? ??. ??????????? Python ???????????? ?????????????? ? ?????????????? ??? ?????? ? ??????????? ??????, ?????????????? ??????, ?????????? ?????????? ???????????? ???????????, ?????????? ????????? ? ?.?. ????? ????, ? ??????? ???? ?????????? ???????????? «??????» ?????????????? ???????? ???????. ????? ?? ???? ????? ????????? ???????? ??????? , ??????????? ????????? ???????? ????????????? ??. ???????????? ?????????? ???????? (????????, IBM, Hewlett-Packard, Intel) ???? ?????????? Python ??? ???????????? ????? ?????????.
? ?????? ??? ??????? ?????????? Python ????????? ????????. ? ???? ?????? ?? ????????? ? ???, ??? ????????? ??????? ??? ????????? ?????????, ????? ? ?????????? ? ??? ?? ????????? ??????? ??????????. ??? ????? ???????? ?????????? ????????? Python ?? Linux.
????? ????????? ?? ????????? ? ????????? ??????? ?? ??? ?????? ? Python .
??? ????????? ????? ???????????? ????????? ?????? ???????????? Ubuntu, ?? ???????? ????? ???????????? ??? ?????? ????????????.
???????? ? ????????? Python ?? Linux ???????? ????? ??????. ????? ????? ?????????, ??? ?? ????? ????????????? Python ?????? 3 ??? ??????????????.
?????? ????? ??? ?????????? ?????????? ???????? ???????? ?????? ????????????.
????? ??????? ????????? ???????? ? Linux ? ???????? ?????? ????????? ???????. ????????? ???????? ???????? apt ??? ?????, ?????????? ?????? ???????:
sudo apt update
????? ????? ???????????? ??????? ?????? ????????? ????????? ??? ????????? ?????? Python3 :
sudo apt install python3 -y
??? ??????? ????????? ????????? ?????? Python , ???? ??? ??? ?? ???????????.
?????? ?????????? ?????????? pip ? ????? ??? ???????? ??????? Python.
sudo apt install python3-pip -y
?????? ????????, ?????????? ?? Python ?????????. ??? ????? ????? ???????? ? ??????? ????? ???????:
python3
????? ?????? ???? ?????:
?? ????????? ?????? ? ????????????? ??????, ?????? ????? ????????:
exit() pip -V
???? ?? ??????? ?????? pip ? ??? ??????????? ?????????.
?????????? ???????? ?????????????. ?? ???? ?????????? ?????-???? ???????? ???? ? ?????? ????????? ????? ??????? ???????, ??? ? ????????? ?? ?????????.
???? ????????? ????? ?????????? ?????????? ??? Python :
?? ????? ????????????? ????????? Visual Studio Code , ????????? Py?harm ????? ???????????? ? ?????????????????? ?????????? ? ???????? ???? ?????????. ?? ?? ?????? ???????????? ????? ?? ?????????.
Python ? ???? ?? ????? ?????????? ?????? ???????????????? ? ????. ?? ???????????? ??? ?????????? ???-??????, ????????? ????????, ????????? ????????, ??????? ?????? ? ??????? ???????.
? ???? ?????? ???????????, ??? ? ??????? ????????? ?????? ?????????, ????? ?????? Python ??????????? ? ????? ???????????? ???????. ??? ????? ???? ??????? ??? ????????? ??????????, ??????? ????????? ???????????? ?????? Python.
?? ????? ??????? ???, ??? ??????????? ???????? ??????????, ????? ?????? Python ??????????? ? ???????, ? ??????? ??????????? ?????? Python. ????????, ??? ????????? ????????? Python ??? ?????????? ??????????, ???????????? ?? ???????? ?????? Python, ????????????? ?? ?????? ????????????.
Python ??????????. ?????? ??????? ? ??????? ??????? ???????????? ?? ????????? ?????:
MAJOR.MINOR.MICRO
? ???????? ??? ?????????? ???? ?????????????? ?????????????. ??? ????????? ?????????????? ?????????? ???????? ???????????? Python.
Python ?????????????? ?????????? ? ??????????? ????????????? Linux ? macOS. ? Windows ??? ?????????? ??????? ? ??????????.
????? ??????, ????? ?????? Python ??????????? ? ????? ???????, ????????? ???????python --version???python -V:
python --version
??????? ?????????? ?????? Python ?? ?????????, ? ?????? ??????2.7.15. ??????, ????????????? ? ????? ???????, ????? ??????????.
Python 2.7.15+
?????? Python ?? ????????? ????? ?????????????? ????? ??????????, ? ???????/usr/bin/python?????????? ? ???????? ?????????????? ? ?????? ????????.
? ????????? ????????????? Linux ???????????? ??????????? ????????? ?????? Python. ?????? ???????? ???? Python 3 ??????????python3, ? ???????? ???? Python 2 ??????????python???python2, ?? ??? ????? ???? ?? ??????.
?? ?????? ?????????, ?????????? ?? ? ??? Python 3, ??????:
python3 --version
Python 3.6.8
????????? Python 2 ????????????? ? 2020 ????. Python 3 ? ??? ????????? ? ??????? ?????.
?? ?????? ????????? ???? ?????? ????????? ???????? ???????? Python ???? ?????? 3.8.x. ?????? ?????, ? ????? ??????? ??????????? ????? ?????? ?????? Python 3.
???? ?? ?????? ?????????? ????????? ?????? Python, ????????? ??????? ?? ???????????? ???? ???????????? ???????.
Python 2 ? Python 3 ????????????? ??????. ???, ?????????? ?? Python 2.x, ????? ?? ???????? ? Python 3.x.
??????, ????????? ?? ???? ??????? Python, ????????????? ????????? ????????? ? ???????.sys.version_info????????? ?????????? ?????? Python, ????????????? ? ???????. ??? ?????? , ??????? ???????? ???? ??????? ??????:major,minor,micro,releaselevel?serial.
????????, ? ??? ???? ????????, ??? ???????? ????????? Python ?????? ?? ???? 3.5, ? ?? ?????? ?????????, ????????????? ?? ??????? ???????????. ?? ?????? ??????? ???, ?????? ????????major?minor??????:
???? ?? ????????? ?????? ? ?????????????? Python ?????? ???? 3.5, ?? ?????? ????????? ?????????:
This script requires Python 3.5 or higher! You are using Python 2.7.
????? ???????? ??? Python, ?????????? ??? ??? Python 3, ??? ? ??? Python 2, ??????????? ??????. ?? ????????? ????????? ???, ??????????? ? Python 3.x, ??? Python 2.
??????, ????? ?????? Python ??????????? ? ????? ???????, ????? ??????, ?????? ???????python --version.
????????? ????? ????? ?????????? - ??? ????????? ?????? ??? ? ????? ???? ? ??????????? ??????? ????????????? Python. ? ???? ?????? ?? ???????? ??? ????? ??????? ????????? ????? ??????? ??? ?????? ? Python - ?? ????????? ?????????????? Python ?? ?????? ?????????? ????? ?????????? ? ??????????????? ????????? ?????????? (IDE).
?????? ??? ?? ????????? ? ??????????? ???????, ????? ????????, ?????? ????????? ????? ??? ?????. ???? ????? ?????????? - ??? ?????, ??? ?? ?????? ??????, ??????????? ? ????????? ???? Python-???. ?????? ??????????? ????? ???????????? ??????????? ? ???????????? ??????, ???????? ??? ??????????????? ?? ???????????, ? ?? ?? ??????? ??????????? ???????.
Python - ??? ???? ???????????????? ? ???????? ???????? ?????, ? ??? ????? ?? ??????????? ???????? ???????? ?????????. ???????? ???? ????? ??? ????????? Python ?? ???? ???????:
????????? Python: ???????? ??????????? ???? Python ?? ?????? python.org . ??? ?? ??????? ????????? ?????? Python, ????????? ??? ????????. ???????? ?????????? ?????????? ??? ????? ???????????? ??????? (Windows, macOS ??? Linux).
????????? ??????????: ?????? ???????? ?? ?????????? ???????????, ????? ?????? ??????? ?????????. ??????????? ?????????, ??? ?? ????? ????????? ?????????? ?????? "???????? Python ? PATH". ???? ??? ?????, ????????? ?? ???????? ??? ????? ????????? Python ?? ????????? ??????.
????????? ?????????: ???????? ????????? ?????? ??? ???????? ? ???????
python --version
???python3 --version
(? ??????????? ?? ????? ???????). ?? ?????? ??????? ?????? Python, ??????? ?? ??????????, ??? ???????????? ??????? Python ?? ????? ???????.????? ????????? Python ??? ????? ?????????? ????? ?????????? ??? ????????? ? ?????????? ????? Python-?????. ??? ????????? ????????? ??? ????????????:
???????? ????? ?????????? ??? ???????? ???? ? ??????????? ?? ????? ???????????? ? ????????????. ?????????? ????? ???????? ? IDLE ??? VSCode ??-?? ?? ????????, ? ?? ????? ??? ????? ??????? ???????????? ????? ??????? PyCharm ??? Jupyter Notebook ? ??????????? ?? ????? ????????.
????????? ????? ?????????? Python - ??? ?????? ??? ?? ???? ? ???????? ????????????????. ??? ???????????? ?????????? ????????? ??? ?????????, ???????????? ? ??????? Python-????. ??? ?????? ? ??? ?????????? Python ? ??????? ????? ?????????? ??? ???????? ????, ??????? ??? ????????, ?? ?????? ??????? ? ????????? ????? ? ????? ???? ???????? Python. ??????? ?? ?????? ???????? ????????, ? ??????? ?? ?????????? ???????? ????????? Python ? ?????????? ??????? ????. ???????? ???????????!
???? ??????, ? ??????? ?? ?????? ??????? ???? ? Python. ????????? ???? ????? ??????? ?? ????, ??? ?? ?????????? ???????????? ???? ??? ????? ?????? ?? ?????? ?????? (??????????) ?? (?) ????. ???? ????? ??????????? ??? ???????? ????? ? ??????? ???????????open(), ????? ???????? ?????????? ? ????????? ???????.
??????? ????????? ?? ????????? ?? ????????? ?????????? ???????? ???????:
???? ????? ????? ?? ??????, ?? ????????? ????? ??????????????r
??? ?????? ?????? ??????????? ????????? ??? ??????? ????????????? ? ??, ? ??????? ?????? ??????? ?? ????? ?????????????? ???? ????.
??? ? ??????????? ??? ? Python, ?????????? ?????? ?????, ????????? ? ???????, ????? ??????. ????????, ??????? ???? ?? Python ????? ????? ??????? ????:
myFile = open("new.txt", "w+")
? ??????????? ???? ??????? ?? ??????? ???? new.txt ??? ?????? ? ??????. ? ????? ??????, ????????? ???? ??? ?? ??????????, ?? ????????? ?????????????.
?????open()????????? ????????? ??????????, ???? ? ??????????? ??????? ?? ?????? ???????????? ?????? ??? ???:
?? ?????? ???????? ?????? ????????, ? ? ???? ?????? ?? ????? ?????? Python ???r.
?????? ?????????, ?? ????????????? ?????, ????????? ??????????? ???????????, ???????????, ????????? ????? ?????? ? ?. ?. ??? ????????? ?????????????? ?????????? ?? ???? ?????????? ???????????? ??? ??????open
????? ?? ?????????? ????, ??? ?????? ????? ?????????, ??? ?? ??? ???????. ??? ????? ??????? ? ???????close()????????? ??????? ??? ??????? ??? ?with????????? ????? with, ???????????????? Python, ??????? ????????????? ????????? ??? ??? ?????? ?? ??????? ?????????. ????? ???????? ????? ?? ?????? ?? ????? ???????? ??? ?????? ??? ?????? ? ????? ????, ???? ?? ?? ???????? ??? ????????? ?????.
?????????? ????? ?????? ????????? ???????? ? ?????????????? ????????? ????????, ???????? ?????? ????? ????????? ? ? ????????? ??????? ???????????? ????????????? ????? ?????? ?????. ?????? ?????? Python ????????? ????????????? ????????? ?????, ????? ??? ?????? ?? ????????????, ?? ??? ?? ??????? ?????????? ?? ???.
? ????? ?? ?????????? ?????? ??????????????, ??? ?????????? Python ?? ???????????? ??????? Windows ? Linux. ???? ???????? ???????? ??????? ? ?????????????? ?????? ? «????????». ????? ??????????? ??? ???????? ??????? ????????? ???: ????????????? ????? ????????? ???? , ????????? ? ??????? ?????????? (????????????? ?????), ? ????? ?????????? ?????? ? ????? (???????? ?????). ????????? ???????? ?????? ??? ??????????? ??????? ????????? ? ???? Python ? Windows ? Linux. ???????? ???????????? ??? ??????????.
???? ???????????????? «??????» ???????? ???????????????? . ? ???? ????????? ????? ???????, ??? ????? ????? ?????????, ???????????? ??? ????? ? ??????????? ??????????, ?????????????? ?? ??????.
?????????? ?? ????????? ????? ?????, ??????? ?????????, ??? ????? ???????????????? ??????: ? ?????????????? . ? ???????????????? ????? ??? ??????????? ? ???????? ? ?????? ?????????? ?????????. ????? ??????????????? ?????????? ? ???????? ????????? ????? (???? ?????). ??????????? ????? ????????? ????? ??? ?????????????? ??????????? ??????? (??????????? ?????????? ??????? ???????? ?? ??????? ??????? ??????????). ???????? ????????????????? ?????????????? ??????? ???????????????? ???????? C++ ? C; ? ????????????????? . ? ???? ?????? ?????????? ????????? ?????????????? ??????????????? ? ??????????? ???????????????? ? ???? ????????? ????. ????? ?????????? ???? ?? ???? ????????? ? ????????????? «?????» ??? «??????» (Python).
Python ???????? ??????????????? ? 2-? ???????: - ???????? ; - ????????????? .
????????????? Windows ????? ????????? ????????????? ????? ?????? ? ????? ? ??????? ????????? ?????? (CMD, command line interpreter ? ????????????? ????????? ??????). ?????? ????????? ??????, ??????? ??????? ????????? ???????:
python
?????? ?????? ?????? «???????» ? ????????????? ??????. ????? ????????? ?????? ????? ???? ??????????? ?????? (commands) ?? ????????????. ???, ??? ??? ????? ?????????:
????????? ?????? ? ??????? ????. ?????????? ?????? ? ????????????? ????????????? ???????????, ? ??????? ????? ?????? ??????????? ?????????: print("??????, OTUS!") . ? ????? ???? ?????? ?????? ???????????? ????? ???????? ? ?????? ?????.
??????? ??????? ? ??? ???????, ??????? ? ?????????. ?? ???? ?????, ??? ????????? ?????????? ??? ???????????.
?? ??????????? «???????» ??????? ?????? ?? ??????? ???????????? «????????????». ??? ??? ??????? ????? ???????????? ? ? ???????? ????????????, ???????? ??????????.
? ??? ??????????? ??????????????? ?????????, ??? ?????????? ????? ???? ?????? ?????? ? ???? ??????? ?????????????????? ??????? Matlab.
????? ??????? ????? ?? ?????????????? ??????, ?????? ??????? ??????? exit() .
??? ????????? ????? ???????????????? Python ? ????????? ? ??? ???? IDLE . ??? ??????????????? ????? ??????????, ???????? ?? ????? ???? ??????????????, ??????? ??????? ????????????. ??????? ? ??????????? ????? ????????????. ????? ????? ????????????: ? ???????; ? ???????? ????????; ? ????????? ?????????? ? ??????.
????? ????????? IDLE ? Windows, ??????? ??????? ? ???? «????», ??? ????? ??? ??????? ????? ?????? ??????????:
????? ??????? ???????????? ?????? ????????? ?????:
? ??? ????? ???? ?????????? ???????? ? ?????.
???? ?? ???????? ???? ??? Linux, ?? ? ???? ???????????? ??????? IDLE-???????? ?? ??????? ???????????, ??????? ???????? ?? ??????????????. ??? Python 3.4 ??? ????? ????????? ???:
????????? ????? ????? ????????? ???????:
??????, ? ???????????? ??? ???? Python-????? ? ??????????? .py. ?? ???? ????? ????????? ????? ????????? ??????. ??? ????? ?????????? ????????????? Python, ? ? ???????? ????????? ?????????? ??????????????? ????.
??????? ???????????????? ??? ?? ????????. ???????? ??????? ? ????????? ???? ??? ???????? ?????? ????:
????????? ???? ??? ?????? example.py . ????? ?? ????? ???????? ?? ????? C (????? ??????? ? ?????? ?????????? ?? ?????????? ????????????).
?????? ???????? ????????? ??????, ????????? ? ??????????????? ?????????? ? ?????? ????????? ????:
??????? ??????? ? ??????? ? ?????? ??????????, ????? ? ??????? ??? ??????? «??????» ? ???????? ??????, ??????? ? ???????? ?????????. ??? ??????.
??? ??????????? ????????? ???????????? ????????????? ????????? ??? ????????????? ??????????????.
???????? ? https://devpractice.ru/python-lesson2-run/.
????pyproject.tom??? ??????????? ??? ????? ??????????? ?? ????????? PEP 518 . ?? ??????????, ??? ?????? ??????? Python ?????? ????????? ??????????? ??????.
??? ??????????? ???????? ? ?????, ??????? ????????? ? ???????? ?????????? ??????? ? ????????????? ??????????TOML.
?? ???????? ??????????, ????? ??? ??? ???????, ??????, ????????, ??????, ???????? ? ?????? ??????????.
???? ?? ???????? ????????????? ?????pyproject.toml??? ??????????? ?????????? ??????????? ???????. ???????????? ????? ????????? ?????? ? ??????, ??????????? ??? ??????????? ??????? ???????.pyproject.toml???????????? ??????????????? ??????? ? ??????????? ??????????? ??? ??????????????? ??????? ??????????????.
????pyproject.toml????? ???????????? ?????????extras, ??????????? ????????????? ?????????? ?????????????? ???????????. ???????????? ????? ????????????? ?????? ?????? ??????????? ??? ??????? ???????. ??? ???????, ? ???????extras??????????? ?????????????? ??????????, ??????? ???????????? ? ?????? ????????????, ????????pytest.
?????? ??????????? ?????????? ? ???????????? ????pyproject.toml????? ???????????? ????????????? ???? ? ???????????? ?? ?????????? ?????????? ?????????????. ??? ????? ???? ??????????? ???????????, ???????? ?????????????? ? ????????, ????? ???black?mypy. ?????? ???????? ?????pyproject.toml????????? ????????????? ????????? ???????????????? ????? ? ????????? ????????????? ???? ? ???????????? ? ????????????.
??????, ??? ????? ?????? ????????? (???? ?? ???????????? «hello, world» ??? ?? ???????????), ?????? ???????? ?????, ????? ????????? ?? ??????.
??? ???? ??????? ? ????? ??????, ???????? ??????? ?????????? ???????????? ? ????? ?????. ?????????? ??? ??? ??????? ?????? ?????? ?? ???? ????? ??????? ?????????.
????????, ??? ????? ?????? ??? ????? (a, b, c) ? ????? ????? ??????????? ?????????. ??? ??????? ????? ???:
from math import sqrt def square_eq_solver(a, b, c): result = discriminant = b * b - 4 * a * c if discriminant == 0: result.append(-b / (2 * a)) else: result.append((-b + sqrt(discriminant)) / (2 * a)) result.append((-b - sqrt(discriminant)) / (2 * a)) return result def show_result(data): if len(data) > 0: for index, value in enumerate(data): print(f'?????? ????? {index+1} ????? {value:.02f}') else: print('????????? ? ????????? ??????????? ?? ????? ??????') def main(): a, b, c = map(int, input('??????????, ??????? ??? ????? ????? ??????: ').split()) result = square_eq_solver(a, b, c) show_result(result) if __name__ == '__main__': main()
????? ?????????: ????? ??????, ????? ?? ??? ?? ???? ???????, ? ???????????? ? ??????? «?????-?????? ??? ???????? ? ?????? ????? ????????». ??????? ?????? ???????? ????????? ????????? ?? ????????? ???????????? (????/?????????/?????).
????????, ?? ??? ???????? ?????? ? ????. ?????? ?????? ??? ????? ???? ?????? ????????? ???????, ??? ?? ?????? ??? ?? ??????????. ? ? ????? ?????? ???????????? ?????? ??????? ?? ?? ???? ? ?????????????? ???. ??? ??? ????????
? ???? ???????? ?????????? ?????? ?????????, ?????????? ?????? ??????? ??????, ??????? ????? ???????? ?? ???? ?????????;
? ???? ??????? ??????, ????? ??????? ??????????, ????? ????? ?????? ???? ?????????;
? ????????? ????????? ? ???????? ?? ?? ???? ???????? ??????;
? ???????? ?? ??? ????? ? ?????????? ? ???, ??????? ?????? ???? ???????. ???? ??? ????????? ? ??????, ???? ? ?????????? ?????? ??????, ???? ???, ???????? ?? ??????.
????????, ??? ?????? ?????? ????? ????????? ????????? ?????:
????? ?????????, ??? ??????? ?????????, ?????????:
???? ????? 1 > python.exe example.py ??????????, ??????? ??? ????? ????? ??????: 10 0 0 ?????? ????? 0 ????? 0.00 ???? ????? 2: > python.exe example.py ??????????, ??????? ??? ????? ????? ??????: 2 5 -3 ?????? ????? 1 ????? 0.50 ?????? ????? 2 ????? -3.00 ???? ????? 3: > python.exe example.py ??????????, ??????? ??? ????? ????? ??????: 10 0 2 Traceback (most recent call last): File "C:PyProjectstprogerexample.py", line 32, in main() File "C:PyProjectstprogerexample.py", line 27, in main result = square_eq_solver(a, b, c) File "C:PyProjectstprogerexample.py", line 11, in square_eq_solver result.append((-b + sqrt(discriminant)) / (2 * a)) ValueError: math domain error
???? ? ??????? ????? ????????? ??????. ??? ??? ??, ??????? ?? ????? ???????? ? ???????? ???? ????????? ? ?? ????????????? ?????? ? ??????? ??????????????. ? ?????, ????? ????????????????? ??? ??????? ???, ????? ???? ??????? ????????????? ?????????:
def square_eq_solver(a, b, c): result = discriminant = b * b - 4 * a * c if discriminant == 0: result.append(-b / (2 * a)) elif discriminant > 0: #
????????? ??? ????? ???????? ? ??? ??????????? ?????????.
?? ??????, ????? ???????? ????????? ?????????, ??????????? ????????? ????????? ????? ? ????? ????????? ??? ??? ???????? ??????? ????????. ???? ????? ????????? ????? ?????, ???????? ?? ??????? ????? ????? ????????. ? ????? ?? ????? ??????? ?????????????????? ????????????.
????????? ??????????????? ???????????? ??????????? ?? ?????? ??????? ????????????? ???????/???????? ?????? ? ?????????, ??????? ????? ?? ????????. ?? ????, ??? ?????????, ??????????? ?????? ?????????. ? ? ?????? ?????????? ????? Python ???? ????????? ???????, ??????????? ???????????????? ??????? ????????????.