Proble with Python Syntax

l=int(input());

b=int(input());

Area=(l*b);

Perimeter=(l+b)*2;

print(“Area = {} , Perimeter= {}
“.format(Area,Perimeter),sep=”\n”);

for input

3

4

this is giving me output

Area = 12 , Perimeter= 14

why sep is not working
i want

Area = 12 ,

Perimeter= 14

how can i achieve this in single line

Hey @anandprakash1091971, sep doesn’t work that way as you have already specified Area and Perimeter together inside double quotes which makes it print it in a single line. If you want to print Area and Perimeter in different lines using just one line of code then you can use :

print('Area = {}'.format(Area) + '\n' + 'Perimeter = {}'.format(Perimeter))

Replace your print statement with this one and you will get the correct results.

Hope this helps.
Happy Learning :slight_smile:

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.