Area of a square


can anyone help me with the basic script in python to find the area of a square?


that shouldn't be to tricky? You need to multiply the width and height of the square, what is the catch?

Can you show what code you have so far?


.But in a square it's side,right?So i tried taking in the input for side.This is the code i tried.Dont know if its accurate.

to find the area of a square

side=float(input("Please enter the value for side"))

calculate area

print ("area of the square")


print ("area of the square: {:d}".format(area))

seems to be fine? You just need to print the output


Thank you!why do we use curly braces and format(area)?


because format is great to use to combine variable and strings. It gives us much options and flexibility.


Thank you for your advice!!