PythonDSA: Data types

PythonDSA: Data types

**What is Python?**


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

- It was created by **Guido van Rossum**

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



**How to Install Python?**


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

- [Windows Installation](https://www.python.org/downloads/)

- Ubuntu: apt-get install python3.6 ?




Task1:

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


No alt text provided for this image



2. Read about different Data Types in Python.


There are two types of Data Structures in python:


-Primitive Data structure: It is called primitive as they are building blocks for data manipulation and can hold only one type of data.


-Non-primitive data structure: Non-primitive data structure is a type of data structure that can store data of more than one type.


No alt text provided for this image




Primitve data structure consists of the following data types:


?* Integer: whole number[int] Integers represent numeric data – they represent whole numbers from negative infinity to infinity.


No alt text provided for this image

?* String: a collection of the alphabet[str] Strings are used to store data that involves characters (e.g., names or addresses). Strings can be created in Python by enclosing a sequence of characters within a pair of single or double quotes.


No alt text provided for this image

?* Boolean: conditional [True/False] Boolean type only has two types of return values: True and False. These return values are interchangeable with the integers 1 and 0.

No alt text provided for this image

?* Float: floating point [float] Floating points are used for rational numbers that usually end with a decimal figure.


No alt text provided for this image


Non-primitive data structure consists of the following data types:


* List: Python Lists are used to store collections of heterogeneous items; they can be recognized by their square brackets which hold elements and are separated by a comma.


No alt text provided for this image

* Dictionaries: A dictionary is an unordered, changeable, and indexed collection of elements. In Python, dictionaries are written with curly brackets and contain keys and values. See the code below:


No alt text provided for this image


#aws #linux #python #devops

Shubham Londhe

Helping Students and Professionals build their Careers | Experience in DevOps | Python | AWS | PySpark | SQL | NoSQL | 1000+ Learners placed

2 年

python after a long time.. thanks for sharing Manish Negi

回复

要查看或添加评论,请登录

Manish Negi的更多文章

社区洞察

其他会员也浏览了