Day-13 For 90 DAY'S OF DEVOPS
What is Python?
What are the key features of Python?
How to Install Python?
Task1:
Conclusion:
What is Python?
Python is a high-level, versatile, and easy-to-read programming language.
It was created by Guido van Rossum and first released in 1991.
Python emphasizes code readability and simplicity, making it an excellent language for beginners and experienced programmers.
What are the key features of Python?
Simple and Readable Syntax
Interpreted Language
Dynamic Typing
Object-Oriented Programming (OOP)
High-Level Language
Extensive Standard Library
Third-party Libraries
Cross-Platform
Community and Support
Open Source
Indentation-based Syntax
Versatile Applications
How to Install Python?
- For Windows Installation :
Download Python:
Go to the official Python website at python.org/downloads. You will see the latest stable version of Python available for download.
Click on the Downloads tab and then select the Windows option.
Choose the version that matches your operating system (Windows, macOS, or Linux) and the appropriate architecture (32-bit or 64-bit).
Once the executable file download is complete, you can open it to install Python.
Click on Run, which will start the installation process.
If you want to save the installation file in a different location, click on Customize Installation; otherwise, continue with Install Now.
Select the checkbox at the bottom to Add Python 3.7 to PATH.
Once the installation is complete, the below pop-up box will appear: Setup was successful.
Now that the installation is complete, you need to verify that everything is working fine.
Go to Start and search for Python.
You can see Python 3.7 (64-bit) and IDLE.
Let’s open IDLE, which is the short form for Integrated Development Environment, and run a simple print statement.
Python also has a command-line interpreter that works similarly to Python IDLE. Let’s print “Hello world” in the command line.
For Linux Installation:
Most Linux distributions come with Python pre-installed.
To check if Python is installed, open a terminal and type python3 --version.
If Python is not installed, use your package manager to install it.
For example, on Debian-based systems (e.g., Ubuntu), use sudo apt-get install python3.
On Red Hat-based systems (e.g., CentOS), use sudo yum install python3. The package name may vary depending on the distribution..
For Windows the Installation:
After installation, open a terminal (or command prompt on Windows) and type python3 (or python on Windows).
This will start the Python interactive shell, and you should see the Python version information.
You can also check the Python version by typing python3 --version (or python --version on Windows) in the terminal.
For MacOS Installation:
For macOS, download the macOS installer package (e.g., Python 3.9.6 macOS 64-bit installer) and run it.
Follow the installation instructions on the screen. macOS usually comes with a pre-installed version of Python, but it's recommended to install the latest version from the official website.
Task1:
Different Data Types in Python :
In Python, data types are classifications that determine the type of data a variable can hold. Python infers the data type based on the assigned value.
Here are some of the commonly used data types in Python:
Integers (
int
): Integers are whole numbers without a fractional part. They can be positive or negative.Floating-Point Numbers (
float
): Floating-point numbers are numbers with a decimal point or in exponential notation, allowing for fractions and real numbers.Strings (
str
): Strings are sequences of characters, such as text. They are enclosed in single ('') or double ("") quotes.Boolean (
bool
): Booleans represent binary values, eitherTrue
orFalse
, and are often used for making logical comparisons.Lists (
list
): Lists are ordered collections of items, which can be of any data type. They are enclosed in square brackets and can be modified (mutable).Tuples (
tuple
): Tuples are similar to lists but are enclosed in parentheses. Unlike lists, tuples are immutable, meaning their elements cannot be changed after creation.Dictionaries (
dict
): Dictionaries are unordered collections of key-value pairs. They are enclosed in curly braces and provide a way to associate values with unique keys.Sets (
set
): Sets are unordered collections of unique elements. They are enclosed in curly braces and are useful for tasks like removing duplicates.NoneType (
None
): The special valueNone
represents the absence of a value or a null value.
Conclusion: Python serves as a foundational tool for DevOps engineers, providing a solid grounding in programming concepts and a versatile toolkit for building logic and writing efficient programs. Its dynamic typing, control structures, functions, and extensive libraries empower DevOps professionals to automate tasks, manage infrastructure, and streamline workflows. By mastering Python basics, DevOps engineers gain the skills needed to excel in a rapidly evolving landscape, ultimately contributing to seamless software development and deployment processes.
I hope you enjoyed this blog post and learned something new. If you have any questions or suggestions, feel free to leave a comment below or contact me on LinkedIn or GitHub. I would love to hear from you!
LinkedIn (linkedin.com/in/vedant-adhe-4683b0192) and
GitHub (github.com/VedantAdhe)
Connect Vedantadhe19@gmail.com
Thank you for reading and happy coding!
Subscribe to my newsletter
Read articles from Vedant Adhe directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by