welcome_mess = "\n Hello %s, "
name=raw_input('Insert your name ')
print welcome_mess % name
ar_pe=raw_input('Do you pretend to calculate the area or the perimeter? ')
objecto=raw_input('Rectangle or Square? ')
if (ar_pe =="Area") and (objecto=="Rectangle"):
comp_ar_rect = input("\n Insert the lenght of the rectangle ")
larg_ar_rect = input("\n Insert the width of the rectangle ")
tot_area_rect = comp_ar_rect * larg_ar_rect
print "\n The area is: " + `area`
elif...
This is only a piece of the code, so my problem is that I need the user to be able to calculate the area of a rectangle if ar_pe = area and objecto = rectangle, so if both of them are true the user can insert the values and calculate.
But after the user inputs area and rectangle the program closes and it doesn't ask the user for the values to calculate...
I think the problem is in the if statement, I googled this but I found nothing... :c-blink:


Sign In
Create Account


Back to top









