Fibonacci series in python
Python | Fibonacci series This is an example of how to print the Fibonacci series. It takes an input number from the user to print the Fibonacci series. The Fibonacci series is a sequence of …
Print prime number between 1 to 100 in python
Python | Print prime no between 1 to 100 This is an example of how to print all prime numbers between 1 and 100 using for loop. A prime number is a natural number greater …
How to encrypt and decrypt using AWS KMS key in python with boto3
Python | Encrypt and Decrypt using AWS KMS key in python with boto3 This is an example of how to encrypt and decrypt a text using the AWS KMS key. In this, we will use …
How to get an AWS KMS Key description in python with boto3
Python | Get an AWS KMS Key description in python with boto3 The describe_key() function is used to get the key description. It takes KeyArn and returns a dictionary having KeyMetadata. These are some necessary items …
How to get all keys from AWS KMS in python with boto3
Python | get all keys from AWS KMS in python with boto3 This is an example of how we can get all the CMK(Customer Master Key) from AWS KMS. To get all keys from AWS …
Delete records in Django models?
Django | Delete records in Django models Delete query performs an SQL delete query on all rows in the queryset and returns the number of objects deleted and a dictionary with the number of deletions …
Git add to add files to git
Git add | add files to git This command adds the working directory changes to the staging area. It allows to include the updates to a particular file in the next commit. Git add doesn't affect …
Initialize a local Git repository
Git init | Initialize a local Git repository The git init command creates a new Git repository in local. This is usually the first command you will run before working on a new project. git …
Git status to check the status
Git | git status to check the status of the current branch The git status command displays all the necessary information about the working directory and the staging area. git status It displays information like: …
Git checkout to Switch branch
Git | git checkout to Switch branch Git checkout is mostly used for switching from one branch to another. It is also used to check out files and commits. Switch to a branch This command …
Git branch command to create, list and delete
Git | Git branch command to create, list, and delete git branch command is used to create a new branch, list all branches, and delete a branch. Branches allow developers to work on the same project …
How to clone git repository
Git clone | clone git repository Git clone command creates a local copy of the existing source code from a remote repository. git clone ssh://git@github.com/<username>/<repository-name>.git To clone a project from Github: Click on the green button …
Django create query set
Django | Insert record in database using create() function create() create(**kwargs) Create function create a new object with the given `kwargs`, saving it to the database and returning the created object. It creates an object …
Django order_by query set
Django | order_by query set, ascending and descending order_by() The order_by function is used to sort the result-set in ascending or descending order. Ascending Order The order_by function sorts the records in ascending order by …
how to get the first 5 words from a string in python
Python | Get the first 5 words from a string This can be done by using the `split()` and `join()` methods >>> massage = 'Today is a sunny day but tomorrow it might rain' >>> …