Posted By naveen singh on 31 Jan 2023
python-program
print("Hello World !”) # print() function का प्रयोग हम output,message और value provides करने के लिए करते हैं, message को हमेशा हम single या double quotes के अंदर print करते हैं और value को हम single या double quotes में print नहीं करते हैं |
# पहले variable में value assign करना |
a = 2
# दूसरे variable में value assign करना |
b = 4
# दो numbers का addition प्रिंट करना |
print("sum of two numbers:", a+b)
# दो numbers का subtraction प्रिंट करना |
print("subtraction of two numbers:",a-b)
# दो numbers का multiplication प्रिंट करना|
print("multiplication of two numbers:",a*b)
# दो numbers का division प्रिंट करना |
print("division of two numbers:",a/b)
# दो numbers का Modulus/Remainder प्रिंट करना |
print("modulus of two numbers:",a%b)
b= 4 # triangle का base
h=2 # triangle की height
a= 0.5*b*h # triangle का area (a=1/2 x base x height)
print(“area of a triangle:”,a)
a=2 # पहले variable में value assign करना |
b=4 # दूसरे variable में value assign करना |
c=1 # तीसरे variable में value assign करना |
# a,b,c quadratic equation के coefficient है |
d= (b**2)-4*a*c # quadratic equation का discrimenant निकालना (d=b2-4ac)
print("discriminant:",d)
a= 5 # पहले variable में value assign करना |
b= 4 # दूसरे variable में value assign करना |
a= a+b # 5 + 4 = 9 , जहां पर a की value 9 है|
b= a-b # 9 - 4 = 5 , जहां पर b की value 5 है |
a= a-b # 9 - 5 = 4, जहां पर a की value 4 है |
print("value of a:",a)
print("value of b:",b)
a= 5
b= 4
c= 0
c= a # जहां पर c की value 5 है |
b= b+c # जहां पर b की value 9 है|
a= b-c # जहां पर a की value 4 है|
b= b-a # जहां पर b की value 5 है |
print(“value of a:”,a)
print(“value of b:”,b)
L= 4 # जहां L rectangle की length है |
b= 3 # जहां b rectangle की breadth है |
a= l*b # जहां a rectangle का area है |
print(“area of a rectangle:”,a)
p= 1000
r= 5
t= 10
SI = (p*r*t)/100
print(“simple interest:”,SI) # Simple Interest(SI)=(pxrxt)/100
p= 100
r= 6
n= 2
CI= p*(1+r/100)**n
print(“compound interest:”,CI) # Compound Interest(SI)= p*(1+r/100)n
p= 1000
r= 4
n= 3
AI= p*(1+r//100)**n-p
print(“compound interest:”,AI) # Annual Interest(AI)= p*(1+r//100)n -p
avg=0
sum=0
m1=20 # first marks
m2=30 # second marks
m3=40 # third marks
m4=50 # fourth marks
m5=60 # fifth marks
sum= m1+m2+m3+m4+m5
avg=sum/5
print(“sum:”,sum) # print sum of five marks
print(“average:”,avg) # print average of five marks
Manish pandey
Very useful content about list in python
05/04/2023