Why Python is pretty easy when compared to other languages?
1.Easy syntax
For example to add two numbers in c:
#include<stdio.h>
void main()
{
int a,b;
scanf("%d%d",&a,&b);
printf("%d",a+b);
}
Same example in python:
a,b=eval(input("enter a,b values"))
print(a+b)
So it is pretty easy to write code in python. If you are beginner to write a code then python is good to learn.
2.Scripting programming language
In above example, we seen that we have declared what data type it is before a,b variables we have to specify which data type it belongs to?
But in python when we give input suppose:
a=10
10 is an integer no need to mention what datatype it is like int,float,char,string...
By default it will treat as string only.
For example to add two numbers in c:
#include<stdio.h>
void main()
{
int a,b;
scanf("%d%d",&a,&b);
printf("%d",a+b);
}
Same example in python:
a,b=eval(input("enter a,b values"))
print(a+b)
So it is pretty easy to write code in python. If you are beginner to write a code then python is good to learn.
2.Scripting programming language
In above example, we seen that we have declared what data type it is before a,b variables we have to specify which data type it belongs to?
But in python when we give input suppose:
a=10
10 is an integer no need to mention what datatype it is like int,float,char,string...
By default it will treat as string only.
Comments
Post a Comment