❄Day 13 Task :- Basics of Python

·

2 min read

❄What is Python?

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

It was created by Guido van Rossum, and released in 1991.

Python consists of vast libraries and various frameworks like Django, Tensorflow, Flask, Pandas, Keras, etc.

How to install Python? let us discuss this.

You can install Python in your System whether it is Windows, macOS, Ubuntu, centos, etc. Below are the links for the installation.

Task-1 :-

Install Python in Ubuntu and check the version:-

Syntax :- sudo apt install -y python3-pip

python3 --version

2. Read about different Data Types in Python.

Python Data Types - javatpoint

Python data Types:

There are several types of data types in Python. Some built-in python data types are which are as following:

1 Python Numeric Data Types:

A numeric data type is used to hold numeric values like;

a) int- holds signed integers of non-limited length

b) long-holds long integers

c) float-holds floating precision numbers.

d) complex-holds complex numbers.

2 Python String Data Type:

The String is a sequence of characters, Python supports Unicode characters. Generally, strings are represented by either single or double quotes

3 Python List Data Types:

Lists are just like arrays, which are used for collection of data. it is very flexible as the items in a list do not need to be of the same type.

# list of having only integers :-

# list of having only strings :-

# list of having both integers and strings :-

4 Python Tuple:

it is another data type which is a sequence of data similar to a list. but it is immutable. Data in a tuple is written using parenthesis() and commas.

Tuples in Python | Codingal

A Comprehensive Guide to Tuples in Python

5. Python Dictionary:

Python Dictionary is an unordered sequence of data of key-value pair form. It is similar to the hash table type. Dictionaries are written within curly braces in the form key: value. It is very useful to retrieve data in an optimized way among a large amount of data.

# print value having key=1

# print value having key=2

# print value having key=3

Thank you for Reading.

***************************Happy Learning*******************************