Python Day 2
Python Continued...
Python is procedural oriented as well as object oriented programming language. We will discuss what they both mean but in Programming there are 2 types of programming,
1. Object oriented
2. Procedural oriented
So what are they?
Procedural oriented programming language is a programming language that is step by step approaching and a language that uses classes and objects.
Example:
m1()
{
-> Logic
}
m2()
{
->Logic
}
Main()
Example of Procedural Oriented Programming Language:
*C languages
Due to the limitations of Procedural Oriented Programming Language, experts have introduced a new programming language known a Object Oriented Programming Language.
What is Object oriented Programming language?
A language that comprises of classes and objects.
Class c1
{
m1 ()
{
->logic
}
m2()
{
->logic
}
{
class c2
{
Main()
c1.m1()
c1.m2()
Example for object oriented programming language
*C#.NET
*Java
*Perl
Why is python both a procedural oriented and object oriented programming language?
In python we can write a program without class which only functions it supports procedural oriented so python is procedural and object oriented.
Python is dynamically types programming language which means that while declaring variables, the programmer doesn't have to require to declare data type will be deciding dynamically when initialize value. Example
if initialize num vals data type = int
if initialize float val data type = float
a = 10
type(a)
<class 'int'>
b = 100.100
type(b)
<class 'float'>