What is Python?
Python is Open source, general purpose, high-level, and object-oriented programming language.
Guido van Rossum created it
Python consists of vast libraries and various frameworks like Django, Tensorflow, Flask, Pandas, Keras, etc.
Python is also platform-independent, which means that Python code can run on different operating systems, such as Windows, macOS, and Linux. This makes it a flexible and portable language that can be used for various applications.
Task1:
1. Install Python in your respective OS, and check the version.
sudo apt-get update
sudo apt install Python3 -y
python3 --version
2. Read about different Data Types in Python.
Python supports the following data types:
Numeric types:
int: represents integer values (e.g: 1, 2, 3).
float: represents floating-point numbers with decimal places (e.g: 3.14, 2.0).
complex: represents complex numbers in the form a + bi (e.g: 2+3j).
Boolean type:
- bool: represents either True or False.
Sequence types:
str: represents a sequence of characters.(e.g: "Hello World!", "Test string")
list: represents an ordered collection of elements that can be changed (mutable). (e.g: a= [1,2,3,4,5,6])
tuple: represents an ordered collection of elements that cannot be changed (immutable). (e.g: tuple = ("parrot", "sparrow"))
range: represents a sequence of numbers that can be iterated over. (e.g: range(5) returns 0, 1, 2, 3, 4)
Set types:
The set represents an unordered collection of unique elements. (e.g: myset = {"apple", "banana", "cherry"})
NoneType:
NoneType is a special data type in Python that represents the absence of a value. It is often used as a default value or a placeholder. (e.g: x = None => print(x))
Mapping type:
- dict: represents a collection of key-value pairs. (e.g: a = {1:"first name", 2: "last name", "age":33})
Thanks for Reading!! ๐