Python Basics

Python Basics

#day13 - #90daysofdevopschallenge

Let's Start a new chapter of our 90daysdevopschallenge Journey.

What is Python?

Python is an open-source, general-purpose, high-level, and object-oriented programming language.

It was created by "Guido Van Rossum".

It is being used in Web development, Machine Learning along with all cutting-edge technology in the IT industry.

Why learn Python?

It is currently the most widely used multi-purpose high-level programming language.

It consists of a lot of libraries and various frameworks like Django, Tensorflow, Pandas, Keras, etc.

Features of Python:

a) Readability

b) Large Standard Library

c) Extensible

d) Interpreted Language

Installation of Python in Windows:

Step1: Download Python Installer

Go to the official website Python Installer Download and choose a stable version of the Python 3 release.

Step2: Run the executable installer

After downloading the installer, go into the download folder and double-click on the .exe folder.

Step 3: Now click on Install and then click OK.

Step 4: After successfully setting up Python in your system.

Step 5: Adding Python to your environment variable.

Go to Start and enter advanced system settings in the search bar.

  1. Click View Advanced System Settings.

  2. In the System Properties dialog, click the Advanced tab and then click Environment Variables.

  3. Depending on your installation:

    • If you selected Install for all users during installation, select Path from the list of System Variables and click Edit.

    • If you didn’t select Install for all users during installation, select Path from the list of User Variables and click Edit.

Task 1: Install Python in your respective OS, and check the version.

Step 6: Verify Python Install successfully in your system.

Go to Start and enter cmd in the search bar. Click Command Prompt.

Enter the following command in the command prompt to verify:

python --version

Task 2: Read about different Data Types in Python.

Data Types: Data types are basically used to represent which kind or type of value you used to perform the operation.

In Python everything is object since data types are actually classes and variables are instances of these classes.

In Python, multiple data types exist

Numeric: The numeric data type in Python represents the data that has a numeric value. A numeric value can be an integer, a floating number, or even a complex number.

a) Integers: It is represented by int class. In Python, there is no limit to how long an integer value can be. It contains positive or negative whole numbers.

b) Float: It is represented by the float class. It contains a decimal point.

c) Complex Numbers: It is represented by a complex class.

syntax: (real_part)+(imaginary_part)j

Sequence: It is the ordered collection of similar or different data types. It allows multiple values in an organized and efficient fashion.

a) String: It is a collection of one or more characters put in a single quote, double quote, or triple quote. A character is a string of length one.

b) List: It is a mutable data type. It is an ordered collection of objects. List defined inside the square bracket.

c) Tuples: It is the same as the list. but the difference between list and tuples is that tuple are immutable, and cannot be modified after it is created. Tuples are defined inside the parentheses.

Boolean: In the boolean data type, there are only two built-in values: True or False.

Set: It is an unordered collection of data types. The order of elements in a set is undefined though it may consist of various elements.

Dictionary: It is also an unordered collection of data types. It stores value in the form of a key-value pair, not a single value compared to other datatypes.

Thank you for giving your precious time to read this blog/article and if any suggestions or improvements are required on my blogs feel free to connect on Linkedin Unnati Gupta. Happy Learning !!!