Skip to main content

Command Palette

Search for a command to run...

#90DaysOfDevops | Day 15

Day 15 -> Basics of Python for DevOps Engineers

Published
2 min read
#90DaysOfDevops  | Day 15

What is Python?

  • Python is an 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 on your system, whether it is Ubuntu.

  • Ubuntu: apt-get install python3.6

    Task 1:

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

    2. Read about different data types in Python.

Task 2: Read About Different Data Types in Python

Understanding data types is crucial for programming in Python. Here are some basic data types in Python:

  • Integers: Whole numbers (e.g., 1, 2, 3)

  • Floats: Decimal numbers (e.g., 1.1, 2.5, 3.14)

  • Strings: Sequence of characters (e.g., "hello", "world")

  • Lists: Ordered collection of items (e.g., [1, 2, 3], ["a", "b", "c"])

  • Dictionaries: Key-value pairs (e.g., {"name": "Alice", "age": 25})

  • Tuples: Immutable ordered collection of items (e.g., (1, 2, 3))

  • Sets: Unordered collection of unique items (e.g., {1, 2, 3})

Datatypes

Integer :



# Integer
a = 5
print("The value of a is:", a)
print("The type of a is:", type(a))
  1. Floats
# Float
b = 3.14
print("The value of b is:", b)
print("The type of b is:", type(b))
  1. Strings
# String
c = "Hello, DevOps!"
print("The value of c is:", c)
print("The type of c is:", type(c))
  1. Lists
# List
d = [1, 2, 3, "a", "b", "c"]
print("The value of d is:", d)
print("The type of d is:", type(d))
  1. Dictionaries
# Dictionary
e = {"name": "Alice", "age": 25}
print("The value of e is:", e)
print("The type of e is:", type(e))
  1. Tuples
# Tuple
f = (1, 2, 3)
print("The value of f is:", f)
print("The type of f is:", type(f))
  1. Sets
# Set
g = {1, 2, 3}
print("The value of g is:", g)
print("The type of g is:", type(g))

Happy Learning! 🚀