1. 程式人生 > >Python2 和 Python3 中的關鍵字

Python2 和 Python3 中的關鍵字

         Python2中共有31個關鍵字:

         and              del                from                not                 while

         as                elif                global             or                   with

         assert         else              if                      pass              yield

         break          except         import             print

         class           exec            in                     raise

         continue      finally          is                     return

         def               for               lambda           try

         Python3中,exec 不再是關鍵字,但nonlocal是一個新的關鍵字。