Introduction to Python Programming

Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python’s elegant syntax and dynamic
Typing, together with its interpreted nature, make it an ideal language for scripting and rapid application
Development in many areas on most platforms.
Whether you are an experienced programmer or not, this website is intended for everyone who wishes to learn Python programming language.
After you complete the Blog , you can get the basics python programming commands which will help you towards advanced commands of python programming
Let’s learn python Basics step by step:
Python has straight forward syntax; it helps programmers to code without any preparation
Very basic directive is print directive, which prints a line.
So to print string in python we need to use below syntax:
print(“This line will display.”) |
If you are already well known in the programming or coding we all know for the indentation we were used {}, instead of this python using ()
So, if you want to print the line Hi! I’m learning python, you need to follow below syntax
print(“Hi! I’m learning python”) |
it is object oriented programming language, not all the times you need to declare variable, every variable is considered as an object.
Single or double quotes: you can use any of this for this string
Below is the simple way to use the operators and strings together, |
three = 3
five = 5 |
eight = three + five |
print(eight) |
|
Let’s go for the basic operators:
Arithmetic Operators: Like other programming languages we can perform addition, subtraction, multiplication, and division operators in python.
AdditionOftwo = 5 + 8 |
Print(AdditionOftwo) |
Modulus = 14 % 8 |
print(Modulus) |
Squreroot and cube functions in the python |
twoSquare= 2 ** 2 |
threecube= 3 ** 3 |
print(twoSquare) |
print(threecube) |
One step ahead Pattern programs in Python. it is extremely important for you to understand Pattern program in Python.
there are four basic types of pattern programs
You all must run this program so that output will surprise you definitely
> Number Pattern Problem
#Program to print the pattern using the number
#Declare number of rows
rows = int(input(“Enter number of rows:”)) |
#Outer loop will print number of rows |
for m in range(0, rows+1): |
#Inner loop will print value of m |
for n in range(0, m): |
print(m,end=” “) #Print number |
print(“\r”) |
> Pyramid Pattern Problem
#Program to print half pyramid using the number
#Declare number of rows
rows = int(input(“Enter number of rows:”)) |
#Outer loop will print number of rows |
for m in range(1, rows+1): |
#Inner loop will print number of column |
for n in range(1, m+1): |
print(n,end=” “) |
print(“\r”) |
Conclusion: For now it’s enough but in my next blog I would like to introduce python frameworks which provide the basic infrastructure for developing a robust Python software application. Depending on the software project your team is trying to build, there are better and worse Python frameworks suited for its purpose.