Day 13: Basics of Python

Day 13: Basics of Python

ยท

2 min read

#Day13 of #90DaysofDevops challenge

Click here to view Day 13 Task.

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:

Task:

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

  2. Read about different Data Types in Python.

    In Python, data types represent the type of value that a variable can hold. The most commonly used data types in Python include:

    • Integer: Integers are whole numbers without any decimal point. They can be positive, negative or zero. For example, 5, -10, and 0 are all integers.

    • Float: Floats are numbers that have a decimal point. For example, 3.14 and -2.5 are floats.

    • String: Strings are sequences of characters, enclosed in single or double quotes. For example, "Hello" and 'World' are both strings.

    • Boolean: Booleans represent truth values and can only have two possible values- True or False.

    • List: Lists are ordered sequences of items, enclosed in square brackets and separated by commas. They can contain elements of different data types. For example, [1, 2, 3] is a list of integers, and ["apple", "banana", "cherry"] is a list of strings.

    • Tuple: Tuples are similar to lists, but they are immutable, which means that their elements cannot be changed once they are created. They are enclosed in parentheses and separated by commas. For example, (1, 2, 3) is a tuple of integers.

    • Set: Sets are unordered collections of unique elements, enclosed in curly braces and separated by commas. For example, {1, 2, 3} is a set of integers.

    • Dictionary: Dictionaries are unordered collections of key-value pairs, enclosed in curly braces and separated by commas. Each key in a dictionary maps to a corresponding value. For example, {"name": "John", "age": 30} is a dictionary where "name" and "age" are keys and "John" and 30 are their corresponding values.

Thank you for reading! ๐Ÿ

Nidhi

ย