How to create new partition from C: drive in windows 10 without formatting

  • In Windows 10 PC, you have C: drive which contains all program files, in addition, it also has all your saved word documents, photos, and your important files. If your operating system becomes corrupted in case of the worst scenario, then all your important files will get lost.
  • To avoid such data loss and to keep your most important files separate, we will go for a separate space from your C: drive using a partition. By doing this, even if your operating system gets corrupt, we will likely be able to get all your important files safely.
  • It is always safer and best practice to put your personal files or important files on a different partition.
  • This blog post demonstrates how easily we can partition the C: drive using a built-in disk manager in windows 10.

While loop

What is While loop in Python?
  • A While loop in Python is used to execute a set of statements/ iterate over a block of code repeatedly as long as the given condition is true.
  • While loop is preferred when we don't know the number of iterations.
Syntax:
                    while condition:
                            body statements
  • The body statement of the while loop is separated from the rest of the code using indentation [tab].

For loop

What is For loop in Python?
  • A for loop in python has the ability to iterate over items of any sequence (List, tuple, string) or any other iterable objects.
  • Iterating over a sequence is called traversal.
Syntax:
                    for var in sequence:
                            body statements
    
  • Here, var is a variable that is used to take the next values from the sequence on every iteration until the end of the sequence is reached.

If, If...else, If...elif...else, Nested If

What is a selection statement in Python?
  • In some cases in programming, Our program has to decide whether the following block of codes needs to be executed or not, based on some conditions.
  • Such Decision making statements/selection statements decide the direction of the flow of program execution.
  • Decision making statements/selection statements available in Python are
        • if (Simple If)
        • if-else
        • else-if ladder
        • Nested if
  • In python, body statements inside the selection statement are indicated by the indentation. The very first unindented line marks the end of the selection statements.

Dictionaries in Python

What is Dictionary in python?
  • Dictionary is an unordered collection of data in the form of key-value pair.
  • The first element in the key-value pair is the key and the second element is the value.
  • Like list, dictionaries are mutable.
Creating a dictionary
  • Dictionaries are written inside curly brackets ({}) with comma-separated key-value pairs.

Tuples in Python

1) What is Tuple?
  • Just like List, Tuple is a collection of ordered elements. But the difference between list and Tuple is, tuples are immutable i.e. the elements in the Tuple cannot be changed, once it is assigned.
  • Tuples also can store both homogeneous and heterogeneous elements.
2) Creating a Tuple
  • Tuples can be created by placing all the elements separated by commas inside parentheses().

Sets in python

What is Set?
  • Set is an unordered collection data type with no duplicate elements. (unique elements)
  • Using curly braces {} or keyword set, we can create a set in Python.
  • In general, the set function is used to eliminate duplicate elements in a list.

Python Comments

  • Comments are the lines that are used to make your code more readable.
  • Comment lines are mainly used for documentation purposes to make the readers understand the source code.
  • These are the lines skipped during the program's execution by the compilers and the interpreters.
  • Sometimes, comments can also serve to prevent the execution of a line when testing code.
  • There are three types of comments in python.
    • Single line comments 
    • Multi-line comments
    • Docstring comments

You might also like

Deploy your Django web app to Azure Web App using App Service - F1 free plan

In this post, we will look at how we can deploy our Django app using the Microsoft Azure app service - a free plan. You need an Azure accoun...