Advertisement
here2share

Most Basic Of Python Syntax

Jan 20th, 2023
864
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.91 KB | None | 0 0
  1. Most Basic Of Python Syntax
  2.  
  3. "+", "-", "*", "/", "%", "**"
  4. "+=", "-=", "*=", "/=", "%=", "**=", "&=", "|=", "^=", ">>=", "<<="
  5. "==", "!=", ">", "<", ">=", "<="
  6. "[{expression} for {variable_name} in {iterable}]"
  7. "abs({object})"
  8. "all({iterable})"
  9. "and", "or", "not"
  10. "any({iterable})"
  11. "append()", "extend()", "insert()", "remove()", "pop()", "index()", "count()", "sort()", "reverse()"
  12. "break"
  13. "chr({integer})"
  14. "clear({dictionary_name})"
  15. "continue"
  16. "dict({iterable})"
  17. "dir({object})"
  18. "divmod({object})"
  19. "enumerate({iterable})"
  20. "eval({expression})"
  21. "exec({expression})"
  22. "extend({iterable}, {list_name})"
  23. "file({file_name}, {mode})"
  24. "filter({function_name}, {iterable})"
  25. "float({object})"
  26. "for {variable_name} in {iterable}:"
  27. "format({value}, {format_spec})"
  28. "from {module_name} import {specific_module}"
  29. "get({key}, {dictionary_name})"
  30. "getattr({object}, {name})"
  31. "global {variable_name}"
  32. "globals()"
  33. "id({object})"
  34. "if {condition}:"
  35. "import {module_name}"
  36. "in", "not in"
  37. "input({prompt})"
  38. "insert({index}, {value}, {list_name})"
  39. "int({object})"
  40. "is", "is not"
  41. "isinstance({expression}, {class_name})"
  42. "isinstance({object}, {class_name})"
  43. "items({dictionary_name})"
  44. "iter({object})"
  45. "join({iterable}, {string_name})"
  46. "keys()", "values()", "items()", "get()", "pop()", "popitem()", "update()", "clear()"
  47. "keys({dictionary_name})"
  48. "lambda {arguments}: {expression}"
  49. "len()", "max()", "min()", "sorted()"
  50. "len()", "max()", "min()", "sum()", "sorted()"
  51. "len({dictionary_name})"
  52. "len({list_name})"
  53. "len({object})"
  54. "len({string_name})"
  55. "len({tuple_name})"
  56. "list(enumerate({list_name}))"
  57. "list(filter({function_name}, {iterable}))"
  58. "list(map({function_name}, {iterable}))"
  59. "list(reversed({iterable}))"
  60. "list(zip(*{iterable}))"
  61. "list(zip({iterable1}, {iterable2}))"
  62. "list({iterable})"
  63. "locals()"
  64. "map({function_name}, {iterable})"
  65. "max({iterable})"
  66. "min({iterable})"
  67. "next({iterator})"
  68. "open({file_name}, {mode})"
  69. "ord({character})"
  70. "os.access({path}, {mode})"
  71. "os.chdir({path})"
  72. "os.getcwd()"
  73. "os.listdir({path})"
  74. "os.mkdir({path})"
  75. "os.remove({path})"
  76. "os.rename({path}, {path})"
  77. "os.rmdir({path})"
  78. "os.stat({path})"
  79. "pass"
  80. "pop({index}, {list_name})"
  81. "pop({key}, {dictionary_name})"
  82. "popitem({dictionary_name})"
  83. "print({expression})"
  84. "reduce({function_name}, {iterable})"
  85. "remove({value}, {list_name})"
  86. "replace({old}, {new}, {string_name})"
  87. "repr({object})"
  88. "return {expression}"
  89. "rstrip({string_name})"
  90. "set({iterable})"
  91. "setattr({object}, {name}, {value})"
  92. "sort({list_name})"
  93. "sort({tuple_name})"
  94. "sorted({iterable})"
  95. "split({separator}, {string_name})"
  96. "str({object})"
  97. "str.format({arguments})"
  98. "str.format_map({mapping})"
  99. "strip({string_name})"
  100. "sum({iterable})"
  101. "try:" and "except {exception}:"
  102. "tuple({iterable})"
  103. "type({object})"
  104. "update({dictionary}, {dictionary_name})"
  105. "upper()", "lower()", "capitalize()", "count()", "find()", "index()", "replace()", "split()", "join()", "strip()", "lstrip()", "rstrip()"
  106. "upper({string_name})"
  107. "values({dictionary_name})"
  108. "vars({object})"
  109. "while {condition}:"
  110. "with {context_manager} as {variable_name}:"
  111. "zip(*{iterable})"
  112. "zip({iterable1}, {iterable2})"
  113. "{class_name}({arguments})"
  114. "{dictionary_name}.{method_name}({arguments})"
  115. "{file_object}.close()"
  116. "{file_object}.read()"
  117. "{file_object}.readline()"
  118. "{file_object}.readlines()"
  119. "{file_object}.seek({offset})"
  120. "{file_object}.tell()"
  121. "{file_object}.write({string})"
  122. "{function_name}({arguments})"
  123. "{key}:{value} for {variable_name} in {iterable}"
  124. "{list_name}.{method_name}({arguments})"
  125. "{list_name}[{index}]"
  126. "{list_name}[{start}:{end}:{step}]"
  127. "{string1} + {string2}"
  128. "{string_name}.format({arguments})"
  129. "{string_name}.{method_name}({arguments})"
  130. "{string_name}[{index}]"
  131. "{string_name}[{start}:{end}:{step}]"
  132. "{tuple_name}.{method_name}({arguments})"
  133. "{tuple_name}[{index}]"
  134. "{tuple_name}[{start}:{end}:{step}]"
  135. "{var1}, {var2} = {iterable}"
  136. "{variable_name} = {expression}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement