FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 108   



Following program shows you how to calculate square area and circumference.
This program gets square length from user and calculates area and circumference and prints them using following formulas
Area = length X length
Circumference = 4 X length

squareLength = float(input("Enter length of square:"))
areaOfSquare = squareLength * squareLength
print("Area of square is: ", areaOfSquare)
circumferenceOfSquare = 4 * squareLength
print("Circumference of square is: ", circumferenceOfSquare)

Output:

Enter length of square: 7
Area of square is:  49.0
Circumference of square is:  28.0



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News