syntax.mdpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #### Operator
  2. | + | - | * | / | == | > | < | >= | <= | % | ** | // | != | & | >> | << | and | or | not | in | += | -= | *= | /= |
  3. |---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
  4. |√|√|√|√|√|√|√|√|√|√|√|√|√|√|√|√|√|√|√|√|√|√|√|√|
  5. #### Control flow
  6. | Syntax | State |
  7. | --- | --- |
  8. | if | √ |
  9. | while | √ |
  10. | for in [list] | √ |
  11. | for in range(a, b) | √ |
  12. | for in [dict] | √ |
  13. | if elif else | √ |
  14. | for break/continue | √ |
  15. | while break/continue | √ |
  16. #### Module
  17. | Syntax | Python Module | C Module |
  18. | --- | --- | --- |
  19. | import [module] | √ | √ |
  20. | import [module] as | √ | - |
  21. | from [module] import [class/function>]| √ | - |
  22. | from [module] import [class/function>] as | √ | - |
  23. | from [module] import * | - | PikaObj Module Only |
  24. #### List/Dict
  25. | Syntax | State |
  26. | --- | --- |
  27. | l = list() | √ |
  28. | l = [a, b, c] | √ |
  29. | d = dict() | √ |
  30. | d = {'a':x, 'b':y, 'c':z} | √ |
  31. #### Exception
  32. | Syntax | State |
  33. | --- | --- |
  34. |try:| √ |
  35. |except:| √ |
  36. |except [Exception]:| - |
  37. |except [Exception] as [err]: | - |
  38. |except: ... else:| - |
  39. |raise:| √ |
  40. |raise [Exception]:| - |
  41. |finally:| - |
  42. #### Slice
  43. | Syntax | str | bytes | list |
  44. | --- | --- | --- | --- |
  45. | test[i] | √ | √ | √ |
  46. | test[a : b] | √ | √ | √ |
  47. | test[a :] | √ | √ | √ |
  48. #### Other keywords/Syntax
  49. | yield | is | comprehensions |
  50. | --- | --- | --- |
  51. | - | √ | - |