{"id":21341260,"url":"https://github.com/choaib-elmadi/every-python-punctuation","last_synced_at":"2025-04-15T03:08:04.449Z","repository":{"id":240287482,"uuid":"772918813","full_name":"Choaib-ELMADI/every-python-punctuation","owner":"Choaib-ELMADI","description":"Every Punctuation in Python.","archived":false,"fork":false,"pushed_at":"2024-03-22T11:21:12.000Z","size":5,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T03:07:54.731Z","etag":null,"topics":["programming","punctuation-marks","python","scripts"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Choaib-ELMADI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-16T08:32:18.000Z","updated_at":"2024-06-01T10:32:40.000Z","dependencies_parsed_at":"2024-05-17T20:18:34.339Z","dependency_job_id":"b77dc208-557f-4fad-8968-dee958c4f425","html_url":"https://github.com/Choaib-ELMADI/every-python-punctuation","commit_stats":null,"previous_names":["choaib-elmadi/every-python-punctuation"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Choaib-ELMADI%2Fevery-python-punctuation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Choaib-ELMADI%2Fevery-python-punctuation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Choaib-ELMADI%2Fevery-python-punctuation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Choaib-ELMADI%2Fevery-python-punctuation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Choaib-ELMADI","download_url":"https://codeload.github.com/Choaib-ELMADI/every-python-punctuation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248997079,"owners_count":21195799,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["programming","punctuation-marks","python","scripts"],"created_at":"2024-11-22T00:55:57.760Z","updated_at":"2025-04-15T03:08:04.434Z","avatar_url":"https://github.com/Choaib-ELMADI.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Every Punctuation in Python\n\n- ### **_Backtick_** `` ` ``: Doesn't do anything in Python.\n\n---\n\n- ### **_Tilde_** `~`: Bitwise Not operator.\n\n```python\nx = 100\nprint(~x)\n\u003e\u003e -101\n```\n\n---\n\n- ### **_Exclamation Mark_** `!`: Doesn't do anything on it's own. Combining it with `=` makes the not equality operator.\n\n```python\nx = 4\nif x != 5:\n    print(\"x is not equal to 5\")\n```\n\n---\n\n- ### **_Question Mark_** `?`: Doesn't do anything in Python.\n\n---\n\n- ### **_At Sign_** `@`: Its main usage is in decorators.\n\n```python\nimport time\n\n\ndef tictoc(func):\n    def wrapper():\n        start = time.time()\n        func()\n        end = time.time()\n        print(f\"{ func.__name__ } executed in { '{:.2f}'.format(end - start) } seconds\")\n\n    return wrapper\n\n\n@tictoc\ndef do_something_1():\n    print(\"Doing something 1\")\n    time.sleep(2)\n    print(\"Done something 1\")\n\n\n@tictoc\ndef do_something_2():\n    print(\"Doing something 2\")\n    time.sleep(3.5)\n    print(\"Done something 2\")\n\n\ndo_something_1()\ndo_something_2()\n```\n\n---\n\n- ### **_Hash_** `#`: It is primarily used for comments to annotate code.\n\n---\n\n- ### **_Dollar Sign_** `$`: Doesn't do anything in Python.\n\n---\n\n- ### **_Modulo_** `%`: This is the modulo operator, the remain of division. It's also used to format strings.\n\n```python\nx = 98\n\nprint(x%2, x%3, x%5, sep=\" ___ \")\n\u003e\u003e 0 ___ 2 ___ 3\n\nprint(\"x = %s\" % x)\n\u003e\u003e x = 98\n```\n\n---\n\n- ### **_Caret_** `^`: Bitwise Exclusive Or (XOR).\n\n```python\na = 0b1111000010\nb = 0b0000111110\n\nx = a ^ b\n\nprint(bin(a), bin(b), bin(x), sep=\" ___ \")\nprint(a, b, x, sep=\" ___ \")\n\n\u003e\u003e 0b1111000010 ___ 0b111110 ___ 0b1111111100\n\u003e\u003e 962 ___ 62 ___ 1020\n```\n\n---\n\n- ### **_Ampersand_** `\u0026`: Bitwise And operator.\n\n```python\na = 0b00110011\nb = 0b11110000\n\nx = a \u0026 b\n\nprint(bin(x))\n\n\u003e\u003e 0b110000\n```\n\n---\n\n- ### **_Asterisk_** `*`: The uses are:\n\n  - ### Multiplication operator\n\n  ```python\n  print(4 * 5)\n  print(3 * \"Hello \")\n\n  \u003e\u003e 20\n  \u003e\u003e Hello Hello Hello\n  ```\n\n  - ### Unpacking operator\n\n  ```python\n  a, b, *others = (4, 5, 12, 4, 5, -2)\n  print(\"a = %s, b = %s, others = %s\" % (a, b, others))\n\n  \u003e\u003e a = 4, b = 5, others = [12, 4, 5, -2]\n  ```\n\n  - ### Allow any number of positional arguments: as a tuple\n\n  ```python\n  def say_hello(*args):\n      print(args)\n\n\n  say_hello(\"Choaib\", 22, \"ENSA\")\n  \u003e\u003e ('Choaib', 22, 'ENSA')\n\n  ```\n\n  - ### Allow any number of keyword arguments: as a dictionary\n\n  ```python\n  def say_hi(**kwargs):\n      print(kwargs)\n\n\n  say_hi(name=\"Choaib\", age=22, school=\"ENSA\")\n  \u003e\u003e {'name': 'Choaib', 'age': 22, 'school': 'ENSA')\n  ```\n\n  - ### Import everything from a module\n\n  ```python\n  from module_name import *\n  ```\n\n---\n\n- ### **_Brackets_** `( )`: Mainly used in functions, create tuples and packing.\n\n---\n\n- ### **_Curly Brackets_** `{ }`: Mainly used to create dictionaries or sets, and in f-strings.\n\n---\n\n- ### **_Square Brackets_** `[ ]`: Mainly used to create lists, access dictionary and tuple items.\n\n---\n\n- ### **_Plus Sign_** `+`: The plus operator.\n\n---\n\n- ### **_Minus Sign_** `-`: The minus operator.\n\n---\n\n- ### **_Underscore_** `_`: The only character that can be inside a variable name.\n\n---\n\n- ### **_Equal Sign_** `=`: Assignment operator. It can be combined with other punctuations to create combined assignment operators like: `+=`, `-=`, `*=`, `/=`, `%=` and `==`.\n\n---\n\n- ### **_Slash_** `/`: Mainly used for true division `/` and floor division `//`.\n\n---\n\n- ### **_Backslash_** `\\`: Mainly used as an escape character. Used also to split a long line of code into multiple lines.\n\n---\n\n- ### **_Pipe Sign_** `|`: Bitwise Or operator.\n\n```python\na = 0b01010101\nb = 0b10101010\n\nx = a | b\n\nprint(bin(x))\n\n\u003e\u003e 0b11111111\n```\n\n---\n\n- ### **_Semicolon_** `;`: Used to squeeze multiple lines of code into one.\n\n---\n\n- ### **_Colon_** `:`: Used in control structures (if else, loops, ...), function definition, try except blocks.\n\n---\n\n- ### **_Single/Double Quotes_** `' \"`: Mainly used with strings.\n\n---\n\n- ### **_Less/More than_** `\u003c \u003e`: Comparison operators, they can be combined with `=` to create `\u003c=` and `\u003e=`. They are also used as a left/right shifts operators.\n\n```python\na = 0b110011\n\nprint(bin(a))\nprint(a)\n\n# Left Shift === Multiplication by 2\nprint(bin(a \u003c\u003c 1))\nprint(a \u003c\u003c 1)\n\n# Right Shift === Division by 2\nprint(bin(a \u003e\u003e 1))\nprint(a \u003e\u003e 1)\n```\n\n---\n\n- ### **_Comma_** `,`: Used to separate the arguments/parameters for a function. It separates the elements in lists, dictionaries, sets and tuples.\n\n---\n\n- ### **_Full Stop_** `.`: Used to access either the methods or the attributes of an object.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchoaib-elmadi%2Fevery-python-punctuation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchoaib-elmadi%2Fevery-python-punctuation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchoaib-elmadi%2Fevery-python-punctuation/lists"}