Search This Blog
Computer science and Information technology related stuffs blog for all the students. All notes and programs are available in our blog. Students and self learners can improve their knowledge and clear doubts themselves by our informative blog post contents. Start learn today by our blog!!
Featured
- Get link
- X
- Other Apps
Calculate Area of Square in Python
Python - Area of Square Calculation
Python - Area of Square Calculation |
Source Code
Aim :
To calculate the area of square by using formula in python.
Algorithm :
- Get the required input from the user by using input statement for 'a'(one side of square).
- Calculate the area of square using formula (a*a).
- Display the result with the help of print statement.
Program :
#calculate area of square using formula in python
#a represents one side of a square and get input from user
a = float(input("Enter the value of one side of a square : "))
#calculate area of square using formula (a*a)
Area_of_square = a*a
#Display the area of square using print statement
print("Area of square is", Area_of_square)
Output :
Enter the value of one side of a square :
4.2
Area of square is 17.64
Terminal Code :
Python - Area of Square Program |
Terminal Output :
Python - Area of Square Output |
Result :
The output was executed successfully and result was verified.
Personal Writings for Readers!!!
Story behind single family described in Pandemic Family Book.
Read more on...
Paperback - https://amzn.to/34NS6Sk
Amazon Kindle - https://amzn.to/3aKtIng
Kobo Writing - https://bit.ly/3iQysNy
Popular Posts
Introduction to Numpy Library in Python
- Get link
- X
- Other Apps
Program for Student Grade Calculation in Python
- Get link
- X
- Other Apps
Comments
Post a Comment