I'm totally beginner, not being able to run this code

name = input(‘write down the area of what you want to get’)
if name == triangle:
l=int('gimme the length: ')
w=int('gimme the width: ')
area = l*w
print(‘the area is {area}’)

it says i didn’t define triangle, help me to define it, if it were an integer i would’ve just wrote int

Here you go:

name = input('write down the area of what you want to get: ')
if name == 'triangle':
    l = int(input('length: '))
    w = int(input('width: '))
area = l*w
print(f'the area is {area}')

To add:

Maybe (from the corrected code that I’ve posted) you can see where you went wrong. If you’re unclear on any aspect, feel free to ask.

…to add to the mathematical part of the code:

  • It is really unclear what is a “length” and a “width” of a triangle.
  • I cannot imagine any reasonable definitions for which the formula l * w would be valid.

The area of a triangle is (width * height) / 2, where one of the sides is the bottom and the opposite corner is the top.