 Python.   ,    
 

 

 


      Python,        .          ,        .   :     ,      .         .     ,   , ,   ,  ,   ,   .





 

 Python.   ,    





 1:   Python


         Python       .     !

       ....    ,        .   -     .      ....  4 .

1.1:   Python?

Python     .  ,      Python  .

  

 ,  ,      ,        ,     .     ,   ""  "".        ,   Python.

  

   Python     .  Python,      ,      .  :

print(", !") 

        ", !".   ,        .

 Python

Python       .  ,       .     -,  ,  ,        .

    Python?      ,          .       Python,              !

1.2:  Python

     Python,         .       Python    :

 Windows:

1.    Python,   -.  : https://www.python.org/downloads/windows/.

2.  Python,   .      (       ).

3.   Python  Windows.  ,        32-  64- .    64-  Windows,   64-  Python.

4.    Python. ,     " Python X.Y  PATH" ( X.Y   Python, , 3.8).    ,     Python   .

5.  " "    .  Python      .

6.   Python       .

 macOS:

1.  (Terminal)   Mac.       "" (Utilities),     "" (Applications).

2.       "Enter":

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 

   Homebrew,  ,    Python.

3.  Homebrew,      "Enter",   Python:

brew install python 

  Python   Mac.

4.    Python :

python3 version 

    Python.

 Linux (Ubuntu):

1.  ( ).

2.    :

sudo apt update sudo apt install python3 

       Python 3   Linux-.

3.  Python   :

python3 version 

    Python.

   Python   ,        . Python  ,            Python.

1.3:    Python

   Python,       .       Python        .    ,    .

1. Python :

Windows:   ""   "Python"  "IDLE (Python)".  .

macOS:  "Terminal" ( )    python3   "Enter".      python  python3,     Python.

Linux:     python3  python     .

2.  :

    Python,   ,   >>>.  ,      Python.

,    :

print(", !") 

  "Enter"    ", !"    .

3. :

Python    .    :

2 + 3 

   5.

4.  :

    Python      ,  exit()  quit()   "Enter".

5. :

       ,           .py.     ,  ,          python _.py.

  Python             .           Python.

1.4: 

        Python,          .        !

   ,   :

1.Python    :  ,         . Python    ,        .

2. Python:    Python  ,       .

3. Python:      Python,         .      .

,     Python       ,   ,        .        ,      .        .

    .      ,       .      .




 2:  


      Python      .       !       Python     ,    .

  

   - .   ,      ", !".      .

print(", !") 

:

print    Python,     .

", !"   ,    .      .

  

,     ,      .

 

1.     .    Notepad, Visual Studio Code, PyCharm      .

2.     :

print(", !") 

3.    .py.  , , hello.py.

 

,    ,    .

1.   ( Windows    " "  "PowerShell",  MacOS  Linux  "").

2.  ,     hello.py.       cd (change directory). :

cd \\ 

3.       hello.py,  :

python hello.py 

   :

, ! 

Python    ,       . ,    ,        Python!

           Python.  ,  -   .         Python .




 3:    


  ?

     ,        .      ,    ,        . ,       ""   ,   10.   ,    10,         .

   Python

 Python,    .       (,      ,   ,      )      (=)     . :

 = 10 

     "",    10.

 

 Python     ,   ,      .       :

1.  (integers):        , , 10, -5, 1000   .

2.  (floats):          ,   3.14, -0.5, 2.0      .

3. (strings):     . , ", !"  .

4.  (booleans):       : True ()  False ().      .

     

        :

 = ""

 = 12

 = 150.5

_ = True

      :

""   "".

""    12.

""      150.5.

"_"    True.

  

    ,     . :

 = 13 

   ""  13,   12.

  

   ,     print(). :

print()

print()

     ""  ""  .

    ,   ,   ,    ,     .          ,           .




 4:   


1:  

       Python,      .    :

 (+):       . :

 = 5 + 3

print() # : 8

 (-):         . :

 = 7  2

print() # : 5

 (*):       . :

 = 4 * 6

print() # : 24

 (/):         .  ,          ( ). :

 = 8 / 2

print() # : 4.0

   (%):            . ,    10 ,         .     ,     1 .    ! :

 = 10 % 3

print() # : 1

        ,    ,       .

2:  

      .     True (),  False ().    :

 (==)      :

,     ,     :   ,     .   ,     ,        .

  ,     Python:

1 = ", 4 "

2 = ", 4 "



_ = (1 == 2)



_  True,   1  2          4 .

   " (==)" ,      ,   ,    .   ,     "True" ();  ,  "False" ().

" " (!=)     :

,          .   ,       .        ,   ,    " "!

  Python  :

_ = ["", "", ""]

_ = ["", "", ""]



 _ != _:

....print("    ,   !")

else:

....print("   ,   !")

      " " (!=)       .     ( ,     ),   ,     .

,  " " (!=)        ,     .

 (>)       .  ,      , , 7  3.  " (>)"   ,    ,   .

   Python, "7 ,  3?" Python  "!"   True ().   ,  "7   ,  3!"

 ,  " (>)"      ,    .        , Python  ""  True.   ,  Python  ""  False ().

 = 7 > 4

print() # : True

 (<):     ,  . ,    ,  .

 = 3 < 6

print() # : True

   (>=)        ,  ,       .

 ,        .      5 ,     3 .     "   (>=)"       .

  : "      ,    ?",   ,   ,          ,   ,   .

   (    5 ,    3),   "   (>=)"    ""  True.        , ,  2 ,       ""  False.

  "   (>=)"    ,         -,   - .

____ = 5

____ = 3



___ = ____ >= ____



___:

....print("      ,    .")

else:

....print("    ,    .")

             (5  3 ).     "   (>=)"          ___.

    ___     if.    True,    "      ,    ."    (else),   False,   "    ,    ."

  ,   "   (>=)"      Python.

   (<=): ,       .

  ,         ,        ,       .      <=:

#     

_ = 10

_ = 3



# ,       

 _ <= _:

....print("   !")

else:

....print("    .")

     _  _.  _    _,    "   !".

,     10   3 .  10     3 ,   ,     .

     <=        .

3:  

         .    :




  .


   .

   ,     (https://www.litres.ru/pages/biblio_book/?art=69576925)  .

      Visa, MasterCard, Maestro,    ,   ,     ,  PayPal, WebMoney, ., QIWI ,       .


