From 44eeee4ab12bcb05ee905a38c9a20eb97a2e0672 Mon Sep 17 00:00:00 2001 From: VARUN KUKRETI <78615537+implosion07@users.noreply.github.com> Date: Sun, 9 Jan 2022 12:32:02 +0530 Subject: [PATCH] Updated code --- area_of_square.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/area_of_square.py b/area_of_square.py index 8ecfe29ab3e..482f2feb706 100644 --- a/area_of_square.py +++ b/area_of_square.py @@ -1,9 +1,5 @@ # Returns the area of the square with given sides -# Side length should eb given in input - -side = 2 -# side = float(input("Enter the side of the square: ")) - -#calculate area -area = side**2 -print(f"Area of the given square is {area}.") +n=input("Enter the side of the square: ") # Side length should be given in input +side = float(n) +area = side * side #calculate area +print("Area of the given square is ",area)