{"id":19381834,"url":"https://github.com/ctechhindi/python-app","last_synced_at":"2026-06-13T04:31:38.880Z","repository":{"id":118143607,"uuid":"131710051","full_name":"ctechhindi/Python-App","owner":"ctechhindi","description":"Python Demo App","archived":false,"fork":false,"pushed_at":"2018-11-16T09:07:35.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-24T16:54:34.718Z","etag":null,"topics":["python","python3","visual-studio-code"],"latest_commit_sha":null,"homepage":null,"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/ctechhindi.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":"2018-05-01T12:21:57.000Z","updated_at":"2018-11-16T09:07:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"48a30eb0-ad86-4128-b9aa-a41d9b5e3b68","html_url":"https://github.com/ctechhindi/Python-App","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ctechhindi/Python-App","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctechhindi%2FPython-App","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctechhindi%2FPython-App/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctechhindi%2FPython-App/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctechhindi%2FPython-App/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ctechhindi","download_url":"https://codeload.github.com/ctechhindi/Python-App/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctechhindi%2FPython-App/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34272603,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["python","python3","visual-studio-code"],"created_at":"2024-11-10T09:18:31.015Z","updated_at":"2026-06-13T04:31:38.865Z","avatar_url":"https://github.com/ctechhindi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Programimg Language\n\nPython is high-level programming language, with applications in numerous areas,including web programming, scripting, scientific computing and artificial intelligence.\n\n\u003e Python is processed at runtime by the interpreter, There is no need to compile your program before executing it.\n\n[GitHub](https://github.com/jeevan15498/Python-App)\n\n[IPython](https://ipython.org/install.html)\n\n## Version : 3.x\n\nPython has several different implementations, written in various languages. `CPython`, is the most popular by far.\n\n## Print Statement [Output Text]\n\n```py\nprint('Hello World')\nprint  \"Hello World\"\n```\n\nThe actual syntax of the print() function is :\n\n`print(*objects, sep=' ', end='\\n', file=sys.stdout, flush=False)`\n\n\n```py\nprint(1,2,3,4, sep='/', end=';')\n# Output: 1/2/3/4;\n```\n\nOutput formatting\n\n```py\nprint('I love {0} and {1}'.format('php','java'))\n# Output: I love php and java\n\nprint('Welcome, {firstname} {lastname}'.format(firstname = 'Jeevan', lastname = 'Lal'))\n# Output: Welcome, Jeevan Lal\n\nf = 17.89585252\nprint('The value of f is %3.2f' %f)\n# Output: The value of f is 17.90\n\nprint('The value of f is %3.4f' %f)\n# Output: The value of f is 17.8959\n```\n\n## Operations\n\nPython has the capability of carrying out calculations.\n\n```css\n\u003e\u003e\u003e 2 + 2\n4\n\u003e\u003e\u003e 5 + 4 - 3\n6\n\u003e\u003e\u003e 2 * (3 + 4)\n14\n\u003e\u003e\u003e 10 / 2\n5.0 # return float\n\u003e\u003e\u003e 5 ** 2 # Power (Exponentiation)\n25\n```\n\n\u003e Using a single slash to divide numbers produces a decimal (or `float`, as it is called in programming). We'll have more about floats in a letter lesson.\n\nDividing by zero in Python produces an error, as no answer can be calculated.\n\n```css\n\u003e\u003e\u003e 11 / 0\nTraceback (most recent call last):\nFile \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\nZeroDivisionError: division by zero\n```\n\n## Input and Variables\n\nHere is a program to show examples of variables:\n\n```py\na =  123.4\nb23 =  'Span'\nfirst_name =  \"Jeevan\"\nb =  432\nc = a + b\n```\n\n__Assigning multiple values to multiple variables__\n\n```py\na, b, c = 5, 3.2, \"Hello\"\nprint(a, b, c)\n```\n\n__Multi-line statement__\n\n```py\na = 1 + 2 + 3 + \\\n    4 + 5 + 6 + \\\n    7 + 8 + 9\n```\n\nCommand-line String Input\n\n```py\nnumber =  input(\"Type in a number: \")\ntext =  raw_input(\"Type in a String :\")\nprint  \"Number is a\", type(number)\n```\n\n\u003e  `type(variable)` : Show variable data type\n\nHere is the list of some string operations:\n\n| Operation | Symbol | Example |\n| --------- | ------ | ------- |\n| Repertition | * | \"i\" * 5 == \"iiiii\" |\n| Concatenation | + | \"Hello, \" + \"World\" == \"Hello, World\" |\n\n## Python  NumbersThere are three numeric types in Python:\n\n-   int\n-   float\n-   complex\n\n```py\nx = 1  # int  \ny = 2.8  # float  \nz = 1j # complex\n```\n\u003e To verify the type of any object in Python, use the `type()` function\n\n- `Float` can also be scientific numbers with an \"e\" to indicate the power of 10. ex : `y = 35e3`\n- `Complex` numbers are written with a \"j\" as the imaginary part. ex ; `y = 5j`\n\n## Python Casting\n\nConversion between data types\n\n```py\nint(10.6) # Output : 10\nint(-10.6) # Output : -10\nfloat(5) # Output : 5.0\nfloat('2.5') # Output : 2.5\nstr(25) # Output : '25'\nset([1,2,3]) # Output : {1, 2, 3}\ntuple({5,6,7}) # Output : (5, 6, 7)\nlist('hello') # Output : ['h', 'e', 'l', 'l', 'o']\ndict([[1,2],[3,4]]) # Output : {1: 2, 3: 4}\ndict([(3,26),(4,44)]) # Output : {3: 26, 4: 44}\n```\n\n## Python  Strings\n\nString literals in python are surrounded by either single quotation marks, or double quotation marks.\n\n`'hello'`  is the same as  `\"hello\"`.\n\n### Methods\n\n- Get the character at position\n\n```py\na = \"Hello, World!\"  \nprint(a[1]) # Output : e\nprint(b[2:5]) # Output : llo\n```\n- The `strip()` method removes any whitespace from the beginning or the end.\n- The `len()` method returns the length of a string.\n- The `lower()` method returns the string in lower case.\n- The `upper()` method returns the string in upper case.\n- The `replace()` method replaces a string with another string.\n- The `split()` method splits the string into substrings if it finds instances of the separator\n\n```py\na = \" Hello, World! \"  \nprint(a.strip()) # returns \"Hello, World!\"\nprint(len(a))\nprint(a.lower())\nprint(a.upper())\nprint(a.replace(\"H\", \"J\"))\nprint(a.split(\",\")) # returns ['Hello', ' World!']\n```\n## Python  Operators\n\n### Python Comparison Operators\n\nComparison operators are used to compare two values:\n```py\n==\t,Equal,\tx == y\t\n!=\t,Not equal,\tx != y\t\n\u003e\t,Greater than,\tx \u003e y\t\n\u003c\t,Less than,\tx \u003c y\t\n\u003e=\t,Greater than or equal to,\tx \u003e= y\t\n\u003c=\t,Less than or equal to,\tx \u003c= y\n```\n\n### Python Logical Operators\n\nLogical operators are used to combine conditional statements:\n\n```py\nand ,Returns True if both statements are true,\tx \u003c 5 and  x \u003c 10\t\nor  ,Returns True if one of the statements is true,\tx \u003c 5 or x \u003c 4\t\nnot ,Reverse the result, returns False if the result is true, not(x \u003c 5 and x \u003c 10)\n```\n\n### Python Identity Operators\n\nIdentity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location:\n\n```py\nis \t,Returns true if both variables are the same object,\tx is y\t\nis not\t,Returns true if both variables are not the same object,\tx is not y\n```\n\n### Python Membership Operators\n\nMembership operators are used to test if a sequence is presented in an object:\n\n```py\nin \t,Returns True if a sequence with the specified value is present in the object,\tx in y\t\nnot in\t,Returns True if a sequence with the specified value is not present in the object,\tx not in y\n```\n\n## Decisions\n\n### if statement\n\n```py\nn = input(\"Number ?\")\nif n \u003c  0:\n    print \"The absolute valu of\", n, \"is\", -n\nelse:\n    print \"The absolute valu of\", n, \"is\", n\n```\n\n\u003e  `if, elif, else` : Multi if else statement\n\n#### Short Hand If\n\nIf you have only one statement to execute, you can put it on the same line as the if statement.\n\n```py\nif a \u003e b: print(\"a is greater than b\")\n```\n#### Short Hand If ... Else\n\nOne line if else statement\n\n```py\nprint(\"A\") if a \u003e b else  print(\"B\")\n```\n\nOne line if else statement, with 3 conditions\n\n```py\nprint(\"A\") if a \u003e b else  print(\"=\") if a == b else  print(\"B\")\n```\n\n## Python Functions\n\n```py\ndef hello():\n    print \"Hello\"\n\ndef area(w, h):\n    return w * h\n\ndef print_welcome(name):\n    print \"Welcome\", name\n```\n## Python Collections (Arrays)\n\nThere are four collection data types in the Python programming language:\n\n*  `List` is a collection which is ordered and changeable. Allows duplicate members.\n*  `Tuple` is a collection which is ordered and unchangeable. Allows duplicate members.\n*  `Set` is a collection which is unordered and unindexed. No duplicate members.\n*  `Dictionary` is a collection which is unordered, changeable and indexed. No duplicate members.\n\n## Python Lists\n\nA list is a collection which is ordered and changeable. In Python lists are written with square brackets.\n\n```py\nthislist = [\"apple\", \"banana\", \"cherry\"]\nprint(thislist[1]) # Access Items\nthislist[1] =  \"blackcurrant\"  # Change Item Value\n```\n### Loop Through a List\n\nYou can loop through the list items by using a `for` loop:\n\n```py\nthislist = [\"apple\", \"banana\", \"cherry\"]\nfor x in thislist:\n    print(x)\n```\n\nOutput :\n\n```\napple\nbanana\ncherry\n```\n\n### Check if Item Exists\n\n```py\nthislist = [\"apple\", \"banana\", \"cherry\"]\nif  \"apple\"  in thislist:\n    print(\"Yes, 'apple' is in the fruits list\")\n```\n\n### Methods\n\n* To add an item to the end of the list, use the `append()` method.\n* To add an item at the specified index, use the `insert()` method.\n* The `remove()` method removes the specified item.\n* The `pop()` method removes the specified index, (or the last item if index is not specified).\n* The `del` keyword removes the specified index.\n* The `clear()` method empties the list.\n* To determine how many items a list have, use the `len()` method.\n\n\n\u003e The `del` keyword can also delete the list completely\n\n```py\nthislist = [\"apple\", \"banana\", \"cherry\"]\n\nprint(len(thislist)) # Output : 3\nthislist.append(\"orange\")\nthislist.insert(1, \"orange\")\ndel thislist[0]\ndel thislist # The del keyword can also delete the list completely\nthislist.clear()\nprint(thislist)\n```\n\n## Python Tuples\n\nA tuple is a collection which is ordered and `unchangeable`. In Python tuples are written with round brackets.\n\n```py\nthistuple = (\"apple\", \"banana\", \"cherry\")\nprint(thistuple)\nprint(thistuple[1]) # Access Tuple Items\n```\n\n* Once a tuple is created, you cannot change its values. Tuples are `unchangeable`.\n* Tuples are `unchangeable`, so you cannot `remove` items from it, but you can delete the tuple completely.\n\n\n## Python Sets\n\nA set is a collection which is `unordered` and `unindexed`. In Python sets are written with curly brackets.\n\n```py\nthisset = {\"apple\", \"banana\", \"cherry\"}\nprint(thisset)\n```\n\n**Note:** Sets are unordered, so the items will appear in a random order.\n\n### Add Items\n\n- To add one item to a set use the  `add()`  method.\n- To add more than one item to a set use the  `update()`  method.\n\n```py \nthisset = {\"apple\", \"banana\", \"cherry\"}\nthisset.add(\"orange\")\nthisset.update([\"orange\", \"mango\", \"grapes\"])\n```\n\n### Remove Item\n\nTo remove an item in a set, use the `remove()`, or the `discard()` method.\n\n\u003e **Note:** If the item to remove does not exist, `remove()` will raise an error.\n\n\u003e **Note:** If the item to remove does not exist, `discard()` will **NOT** raise an error.\n\n* To determine how many\n\n\u003e  `Note:` Sets are unordered, so the items will appear in a random order.\n\n### Methods\n\n* To determine how many items a set have, use the `len()` method.\n* You can also use the `pop()`, method to remove an item, but this method will remove the _last_ item. Remember that sets are unordered, so you will not know what item that gets removed.\n\n**Note:** Sets are _unordered_, so when using the `pop()` method, you will not know which item that gets removed.\n\n* The `clear()` method empties the set.\n* The `del` keyword will delete the set completely. ex: `del  thisset`\n\n\n## Python  Dictionaries\n\nA dictionary is a collection which is unordered, changeable and indexed. In Python dictionaries are written with curly brackets, and they have keys and values.\n\n```py\nthisdict =\t{\n    \"brand\": \"Ford\",\n    \"model\": \"Mustang\",\n    \"year\": 1964\n}\nprint(thisdict)\n```\n\n### Accessing Items \n\n```py\nx = thisdict[\"model\"]\n# There is also a method called `get()` that will give you the same result\nx = thisdict.get(\"model\")\n```\n\n### Loop Through a Dictionary\n\nYou can also use the `values()` function to return values of a dictionary\n\n```py\nfor x in thisdict.values():  \n    print(x)\n```\n\nLoop through both _keys_ and _values_, by using the `items()` function.\n\n```py\nfor x, y in thisdict.items():  \n    print(x, y)\n```\n\n### Methods\n\n* `Check if Key Exists`\n : To determine if a specified key is present in a dictionary use the `in` keyword.\n* `Length` : To determine how many items (key-value pairs) a dictionary have, use the `len()` method.\n* `Removing Items` : The `pop()` method removes the item with the specified key name.\n* The `del` keyword removes the item with the specified key name.\n* The `clear()` keyword empties the dictionary. ex : `thisdict.clear()`\n\n## Python Loops\n\nPython has two primitive loop commands:\n\n* `while` loops\n* `for` loops\n\n### The while Loop\n\n```py\ni = 1\nwhile i \u003c 6:\n    print(i)\n    i += 1\n```\n\n\u003e **Note**: remember to increment i, or else the loop will continue forever.\n\n### Methods\n\n* With the `break` statement we can stop the loop even if the while condition is true.\n* With the `continue` statement we can stop the current iteration, and continue with the next.\n\n### For Loops\n\nA `for` loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).\n\n```py\nfruits = [\"apple\", \"banana\", \"cherry\"]\nfor x in fruits:\n    print(x)\n```\n\nEven strings are iterable objects, they contain a sequence of characters\n\n```py\nfor x in \"banana\":\n    print(x)\n```\n\n## The range() Function\n\nTo loop through a set of code a specified number of times, we can use the `range()` function,\n\nThe `range()` function returns a sequence of numbers, starting from 0 by default, and increments by 1 (by default), and ends at a specified number.\n\n```py\nfor x in range(6):\n    print(x)\n```\n\n\u003e Note that `range(6)` is not the values of 0 to 6, but the values 0 to 5.\n\nThe `range()` function defaults to increment the sequence by 1, however it is possible to specify the increment value by adding a third parameter: `range(2, 30, 3)`\n\n## Python Classes and Objects\n\n* Create a class named MyClass, with a property named x.\n* Now we can use the class named myClass to create objects.\n\n```py\nclass MyClass:\n    x = 5\n\np1 = MyClass()\nprint(p1.x)\n```\n\n### The __init__() Function\n\n* To understand the meaning of classes we have to understand the built-in __init__() function.\n* All classes have a function called __init__(), which is always executed when the class is being initiated.\n\n```py\n# Create a class named Person, use the __init__() function to assign values for name and age:\n\nclass Person:\n    def __init__(self, name, age):\n        self.name = name\n        self.age = age\n\np1 = Person(\"John\", 36)\n\nprint(p1.name)\nprint(p1.age)\n```\n\n\u003e `Note:` The __init__() function is called automatically every time the class is being used to create a new object.\n\nInsert a function that prints a greeting, and execute it on the p1 object:\n\n```py\nclass Person:\n    def __init__(self, name, age):\n        self.name = name\n        self.age = age\n\n    def myfunc(self):\n        print(\"Hello my name is \" + self.name)\n\np1 = Person(\"John\", 36)\np1.myfunc()\n```\n\n\u003e `Note`: The `self` parameter is a reference to the class instance itself, and is used to access variables that belongs to the class.\n\n### Methods\n\n* `Modify Object Properties:` p1.age = 40\n* `Delete Object Properties:` del p1.age\n* `Delete Objects:` del p1\n\n## Python Iterators\n\n## Python Import\n\nA module is a file containing Python definitions and statements. Python modules have a filename and end with the extension `.py`\n\n```py\nimport math\nimport sys\n\nprint(math.pi)\nprint(sys.path)\n\n# Output: 3.141592653589793\n# Output:\n['',\n 'C:\\\\Users\\\\G.one\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python36-32\\\\Scripts\\\\ipython.exe',\n 'c:\\\\users\\\\g.one\\\\appdata\\\\local\\\\programs\\\\python\\\\python36-32\\\\python36.zip',\n 'c:\\\\users\\\\g.one\\\\appdata\\\\local\\\\programs\\\\python\\\\python36-32\\\\DLLs',\n 'c:\\\\users\\\\g.one\\\\appdata\\\\local\\\\programs\\\\python\\\\python36-32\\\\lib',\n 'c:\\\\users\\\\g.one\\\\appdata\\\\local\\\\programs\\\\python\\\\python36-32',\n 'C:\\\\Users\\\\G.one\\\\.ipython'\n]\n```\n\n## Python Modules\n\n* Consider a module to be the same as a code library.\n* A file containing a set of functions you want to include in your application.\n\n### Create a Module\n\nTo create a module just save the code you want in a file with the file extension `.py`:\n\n```py\n# Save this code in a file named mymodule.py\ndef greeting(name):\n    print(\"Hello, \" + name)\n```\n\n### Use a Module\n\nNow we can use the module we just created, by using the `import` statement:\n\n\n```py\nimport mymodule\n\nmymodule.greeting(\"Jonathan\")\n```\n\n\u003e `Note`: When using a function from a module, use the syntax: `module_name.function_name`.\n\n### Variables in Module\n\nSave this code in the file `mymodule.py`\n\n```py\nperson1 = {\n    \"name\": \"John\",\n    \"age\": 36,\n    \"country\": \"Norway\"\n}\n```\n\n```py\nimport mymodule\n\na = mymodule.person1[\"age\"]\nprint(a)\n```\n\n### Re-naming a Module\n\nYou can create an alias when you import a module, by using the `as` keyword:\n\n```py\nimport mymodule as mx\n\na = mx.person1[\"age\"]\nprint(a)\n```\n\n### Built-in Modules\n\n```py\nimport platform\n\nprint(platform.system())\n```\n\n### Using the `dir()` Function\n\nThere is a built-in function to list all the function names (or variable names) in a module. The `dir()` function:\n\n```py\nimport platform\n\nx = dir(platform)\nprint(x)\n```\n\n\u003e `Note`: The `dir()` function can be used on all modules, also the ones you create yourself.\n\n### Import From Module\n\nYou can choose to import only parts from a module, by using the from keyword.\n\n\n```py\n# The module named `mymodule` has one function and one dictionary:\ndef greeting(name):\n    print(\"Hello, \" + name)\n\nperson1 = {\n    \"name\": \"John\",\n    \"age\": 36,\n    \"country\": \"Norway\"\n}\n```\n\n```py\n# Import only the person1 dictionary from the module:\nfrom mymodule import person1\n\nprint (person1[\"age\"])\n```\n\n## Python Datetime\n\nA date in Python is not a data type of its own, but we can import a module named `datetime` to work with dates as date objects.\n\n```py\nimport datetime\n\nx = datetime.datetime.now() # 2018-11-16 12:11:11.644662\nprint(x)\nprint(x.year)\nprint(x.strftime(\"%A\"))\n```\n\n### Creating Date Objects\n\n```py\nimport datetime\n\nx = datetime.datetime(2020, 5, 17)\nprint(x)\n```\n\nA reference of all the legal format codes: [DateTime](https://www.w3schools.com/python/python_datetime.asp)\n\n## Python JSON\n\nPython has a built-in package called `json`, which can be use to work with JSON data.\n\n### Parse JSON - Convert from JSON to Python\n\nIf you have a JSON string, you can parse it by using the `json.loads()` method.\n\n```py\nimport json\n\n# some JSON:\nx =  '{ \"name\":\"John\", \"age\":30, \"city\":\"New York\"}'\n\n# parse x:\ny = json.loads(x)\n\n# the result is a Python dictionary:\nprint(y[\"age\"])\n```\n\n### Convert from Python to JSON\n\nIf you have a Python object, you can convert it into a JSON string by using the `json.dumps()` method.\n\n```py\nimport json\n\n# a Python object (dict):\nx = {\n    \"name\": \"John\",\n    \"age\": 30,\n    \"city\": \"New York\"\n}\n\n# convert into JSON:\ny = json.dumps(x)\n\n# the result is a JSON string:\nprint(y)\n```\n\nYou can convert Python objects of the following types, into JSON strings:\n\n```py\nimport json\n\nprint(json.dumps({\"name\": \"John\", \"age\": 30}))\nprint(json.dumps([\"apple\", \"bananas\"]))\nprint(json.dumps((\"apple\", \"bananas\")))\nprint(json.dumps(\"hello\"))\nprint(json.dumps(42))\nprint(json.dumps(31.76))\nprint(json.dumps(True))\nprint(json.dumps(False))\nprint(json.dumps(None))\n```\n\n### Format the Result\n\nThe example above prints a JSON string, but it is not very easy to read, with no indentations and line breaks.\n\nThe `json.dumps()` method has parameters to make it easier to read the result:\n\n```py\n# You can also define the separators, default value is (\", \", \": \")\njson.dumps(x, indent=4, separators=(\". \", \" = \"))\n```\n\n### Order the Result\n\nUse the sort_keys parameter to specify if the result should be sorted or not:\n\n```py\njson.dumps(x, indent=4, sort_keys=True)\n```\n\n## Python PIP\n\nPIP is a package manager for Python packages, or modules if you like.\n\n\u003e **Note:** If you have Python version 3.4 or later, PIP is included by default.\n\n### What is a Package?\nA package contains all the files you need for a module.\n\nModules are Python code libraries you can include in your project.\n\n### Check if PIP is Installed\n\n```shell\n$ pip --version\n```\n\n### Install PIP\n\nIf you do not have PIP installed, you can download and install it from this page: [https://pypi.org/project/pip/](https://pypi.org/project/pip/)\n\n### Download a Package\n\n```shell\n$ pip install camelcase\n```\n\n### Using a Package\n\nOnce the package is installed, it is ready to use.\n\n```py\nimport camelcase\n\nc = camelcase.CamelCase()\n\ntxt = \"hello world\"\n\nprint(c.hump(txt))\n```\n\n### Find Packages\nFind more packages at https://pypi.org/.\n\n### Remove a Package\nUse the uninstall command to `remove` a package:\n\n```shell\n$ pip uninstall camelcase\n```\n\n### List Packages\n\nUse the `list` command to list all the packages installed on your system:\n\n```shell\n$ pip list\n```\n\n## Python Try Except\n\n* The `try` block lets you test a block of code for errors.\n* The `except` block lets you handle the error.\n* The `finally` block lets you execute code, regardless of the result of the try- and except blocks.\n\n```py\n# The try block will generate an exception, because x is not defined:\ntry:\n  print(x)\nexcept:\n  print(\"An exception occurred\")\n```\n\n### Finally\n\nThe `finally` block, if specified, will be executed regardless if the try block raises an error or not.\n\n\n```py\ntry:\n  print(x)\nexcept:\n  print(\"Something went wrong\")\nfinally:\n  print(\"The 'try except' is finished\")\n```\n\nThis can be useful to close objects and clean up resources:\n\n```py\n# Try to open and write to a file that is not writable:\ntry:\n  f = open(\"demofile.txt\")\n  f.write(\"Lorum Ipsum\")\nexcept:\n  print(\"Something went wrong when writing to the file\")\nfinally:\n  f.close()\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctechhindi%2Fpython-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fctechhindi%2Fpython-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctechhindi%2Fpython-app/lists"}