35
loading...
This website collects cookies to deliver better user experience
Python programming paradigms: Imperative, Functional, Procedural, Object-oriented paradigms
Representing data using python data types: Booleans, strings ,lists, tuples, sets, dictionaries.
Applications of Python in Software development and DevOps engineering automation, data science and machine learning.
PEP8 Rules
Imperative-Python fully implements this paradigm. It uses statements that change a program state and focuses on how to solve.Data structures implement the use of this paradigm.
Functional- It is also known as declarative paradigm It treats every statement as a mathematical equation.
in python, lambda and recursion are approaches used to implement functional programming paradigm.
Procedural- in this paradigm, computational tasks are treated as step by step iteration and common task grouped as functions.
In python, procedural paradigm favors iterations, selection, sequencing and modularization.
Object-oriented- a programming paradigm that relies on concepts of classes and objects and focuses on writing reusable code. Python has object oriented features as methods, inheritance encapsulation and polymorphism.
Performing DevOps tasks- Python enables DevOps professionals to build, test, deploy, visualize and monitor the DevOps lifecycle with improved, simple custom utilities.DevOps tools such as Ansible is written in python.
Education-Python is a superb language for teaching programming, both at the introductory level and in more advanced courses.
a=12
print(a)
b=12.5
c=1.8j,3+4.5j
# Use single quotes
print('Hello there!')
'Hello there!'
#Use double quotes
greeting = "Good Evening!"
print(greeting)
'Good Evning!'
# Use triple quotes
message = """30 Days of Python Challenge!"""
print(message)
'30 Days of Python Challenge!'
print("My name is" + " " + "Korir")
#output
'My name is Korir'
a='phy'
print(a*5)
Output: phyphyphyphyphy
String1 = "Python"
print(String1[3:4])
output=h
numbers=[1,2,3,4,5,7]
print(numbers)
output: [1, 2, 3, 4,5,7]
tuple1=(11,2,43,4)
print(tuple1)
output: (11, 2, 43, 4)
new_dict = {"firstname": "Korir", "lastname": "Mary",
"DOB": 2000}
print(new_dict["lastname"])
output:"Mary"
new_set = {1, 2, 3,4,5}
print(new_set)
output={1, 2, 3, 4, 5}