Volume of Sphere in Python


Find the Volume of Sphere in Python   

 r=float(input("Enter Radius :"))

pie=3.14
volume=(4.0/3.0)*pie*(r*r*r)
print("Volume of Sphere is : ",volume)
Output :
Enter Radius : 10
Volume of Sphere is :  4186.666666666667


 

Volume of cone In Python

Find the Volume of Cone in Python

 h=float(input("Enter Height :"))

r=float(input("Enter Radius :"))
pie=3.14 volume=pie*(r*r)*h/3
print("Volume of Cone is ", volume)

Output :

Enter Height :10 Enter Radius :5 Volume of Cone is 261.6666666666667


Single Table in Python

Display ant Table Input by the User in Python 


 n=int(input("Enter any Number "))

for i in range(1,11):

print('{0} * {1} = {2}'.format(n,i,i*n))

Output :

Enter any Number : 4 4 * 1 = 4 4 * 2 = 8 4 * 3 = 12 4 * 4 = 16 4 * 5 = 20 4 * 6 = 24 4 * 7 = 28 4 * 8 = 32 4 * 9 = 36 4 * 10 = 40

Find Triangle are Equilateral,Isosceles and Scalene Triangle With the help of if, elif,else Statement in python

Program to find the triangle are Equilateral , Isosceles  and Scalene in python 

 x=int(input("x :"))

y=int(input("y :"))
z=int(input("z :"))
if x == y == z:
print("Equilateral Triangle ") elif x==y or y==z or z==x:
print("Isosceles Triangle") else:
print("scalene Triangle")

Output :

x :10 y :45 z :10 Isosceles Triangle


Find The Area of Trapezoid in Python

 #Area of Trapezoid in Python

base1=float(input("Enter Base1 of a Trapezoid :"))
base2=float(input("Enter Base2 of a Trapezoid :"))
height=float(input("Enter Height of a Trapezoid :"))
area=0.5*(base1+base2)*height
print("Area of Trapezoid : ", area)

Output :

Enter Base1 of a Trapezoid :4 Enter Base2 of a Trapezoid :5 Enter Height of a Trapezoid :10 Area of Trapezoid : 45.0



Find Triangle are Isosceles or Not in Python

 # Isosceles Triangle

x=int(input("x :"))
y=int(input("y :"))
z=int(input("z :"))
if x==y or y==z or z==x:
print("Isosceles Triangle")
else:
print("Not Isosceles Triangle")


Output :

x : 12 y :41 z :12 Isosceles Triangle


Area of Square With the Help Of import math in Python

 #Area of Square with math.pow in python

import math
side=float(input("Enter side of square :"))
area=math.pow(side,3)
print("area of square : ", area)


Output :
Enter side of square :10
area of square : 1000.0


Area of Square in Python

 #Area of Square in Python


side=float(input("Enter side of square :"))
area=side*side
print("area of square : ", area)

Output :

Enter side of square :45 area of square : 2025.0


Resume in Python

Resume in Python 


 rafe=str(input("What are you making : "))

name=str(input("Name : "))

age=str(input("Age : "))

da=str(input("Date Of Birth : "))

print("PERSONAL INFORMATION")

fa=str(input("Father Name : "))

ma=str(input("Mother Name : "))

va=str(input("Village  : "))

print("QUALIFICATION ")

pera=str(input("Enter Percentage in 10th class : "))

per=str(input("Enter Percentage in 12th class : "))

ho=str(input("Hobby : "))

aim=str(input("Aim of life : "))

print("\n")

print("***********************************")

print("* \t", rafe  ,"\t          *")

print("* \t", name  ,"\t  *")

print("* \t", age  ,"\t                  *")

print("* \t", da  ,"\t          *")

print("* \t", "PERSONAL INFORMATION"  ,"\t  *")

print("* \t", fa  ,"\t          *")

print("* \t", ma  ,"\t          *")

print("* \t", va  ,"\t          *")

print("* \t", "QUALIFICATION"  ,"\t          *")

print("* \t", pera  ,"\t                  *")

print("* \t", per  ,"\t                  *")

print("* \t", ho  ,"\t  *")

print("* \t", aim  ,"\t  *")

print("***********************************")


Output :

What are you making : Resume
Name : Manpreet Singh
Age : 20
Date Of Birth : 12/05/2000
PERSONAL INFORMATION
Father Name : Manjit Singh
Mother Name : Manpreet Kaur
Village  : Kalanaur
QUALIFICATION 
Enter Percentage in 10th class : 74%
Enter Percentage in 12th class : 85%
Hobby : Playing Football
Aim of life : Software Developer


***********************************
* Resume                                             *
* Manpreet Singh                             *
* 20                                                     * 
* 12/05/2000                                     *
* PERSONAL INFORMATION     *
* Manjit Singh                                     *
* Manpreet Kaur                             * 
* Kalanaur                                     *
* QUALIFICATION                     *
* 74%                                             *
* 85%                                             *
* Playing Football                             * 
* Software Developer                     *
***********************************

Area of Parallelogram in Python

 # Area of Parallelogram

base=float(input("Enter Base of Parallelogram : "))
height=float(input("Enter Height of Parallelogram :"))
area=base*height
print("Area of Parallelogram : ",area)


Output :

Enter Base of Parallelogram : 5 Enter Height of Parallelogram :12 Area of Parallelogram : 60.0



Fibonacci Series with while loop in Python

Fibonacci Series with while loop in Python 👍

 n=int(input("Enter Value of n :"))

a=0
b=1
c=a+b
print(a)
print(b)
while c<=n:
print(c)
a=b
b=c
c=a+b


Output :

Enter Value of n :4 0 1 1 2 3

Fibonacci Series with def fib in Python


Fibonacci Series with  def fib in Python 

 n=int(input(" Enter any Number :"))

def fib(n):

    a=0

    b=1

    if n==1:

        print(a)

    else:

     print(a)

     print(b)

     for i in range(2,n):

         c=a+b

         a=b

         b=c

         print(c)

fib(n)      


Output :

 Enter any Number :4

0

1

1

2  


Factorial of a Number in Python

 Factorial of a  Number in Python

n=float(input("Enter a Number :"))

fact =1

while(n>=1):

      fact=fact*n

      n-=1

print("Factorial :",fact)


Output : 

Enter a Number :5

Factorial : 120.0



Volume of Cylinder in Python


Volume of Cylinder in Python 

 pi=22/7

height=float(input("Height of Cylinder :"))

radius=float(input("Radius of Cylinder : "))

volume=pi*radius*radius*height

print("Volume is : ",volume)


Output :

Height of Cylinder :15

Radius of Cylinder : 5

Volume is :  1178.5714285714284



Volume of Cube in Python

Volume of Cube in Python 

 import math

a=float(input("Enter The Value of a :"))

volume=math.pow(a,3)

print("volume :",volume)


Output :

Enter The Value Of a :4

volume : 64.0


Enter Character in Python

 Enter Character in Python  

nm=(input(" Name :"))

print(nm)


Output :

 Name :Harmanpreet Singh

Harmanpreet Singh



Area of Circle pi* in Python

Area of Circle pi* in Python 

 import math

radius=float(input("Enter radius of the circle : "))

area=math.pi*radius*radius

print("area of circle",area)


Output :

Enter radius of the circle : 4

area of circle 50.26548245743669



Area of circle in python Without pi*

Area of circle in python Without pi* 

 radius=float(input("Enter radius of the circle : "))

area=3.14*radius*radius

print("area of circle",area)


Output :

Enter radius of the circle : 5

area of circle 78.5



Area of Rectangle in Python

    

Area of Rectangle  in Python 

#Area of Rectangle 

width=float(input("Enter the width of the  Rectangle :"))

height=float(input("Enter the height of the  Rectangle :"))

area=width*height

print("area of the rectangle",area)

print("\n")


Output :

Enter the width of the  Rectangle :41

Enter the height of the  Rectangle :5

area of the rectangle 205.0



Add two Integer in Python

Add two Integer  in Python 


a= int(input("Enter First Number : "))

b= int(input("Enter Second Number : "))

 a=3

b=5

sum=a+b

print("sum of two numbers")

print(a,"+", b, "=",sum) 


Output : 


Enter First Number : 4
Enter Second Number : 4
sum of two numbers
4 + 4 = 8

Print Name in Python

Print Name in Python 


nm=str(input("Enter Name : "))

print(nm)



Output :

Enter Name : Gurnoor

Gurnoor


Count Upper Case and Lower Case Word in a string (Python)

  Count Upper Case and Lower Case Word in a string     (Python) def string_test(s):     d={"UPPER_CASE":0, "LOWER_CASE":...