I need help to make this code work

can anyone help me make this code work:

program reads the width and height of a wall, calculates its area and amount of paint needed

import random

height = [2, 2.34, 3, 3.45, 4, 6, 10.2]

width = [15, 100, 6.67, 3.99, 5.67, 2.67, 200]

removes 2 values from this list

random_height = random.sample(height, 1)

random_width = random.sample(width, 1)

Turn into square meters

square_meters = [random_height * random_width for random_heigh,random_width in zip[(height, width)]

divided by the total area of the ink

amount of ink = square_meters[ * 2]

print(f With a wall of {random height:.2f} height x {random width:.2f} width\nYou will need {quantity_paint:.2f} of paint buckets.')

How are we supposed to help if we don’t know what’s wrong with it?

And please format the code, as explained in the pinned topic.

check your spelling. random_heigh <> random_height

sorry! I’m trying to calculate the height * width but it’s giving me an error:

  • when i print I am receiving this message:
    typeError: unsupported format string passed to list.__format

  • What Im trying to do:
    random_height * random_width

that was a translation error. I originally didn’t write this code in English.

For best results, please read the pinned thread, and then make sure of the following:

  1. Edit the first post to make these changes (don’t make a new post).

  2. Post the necessary code with proper formatting (using what you learned from the pinned thread).

  3. Make sure (by trying it yourself before submitting the edit) that someone else can copy and paste the code out of the post, without adding or changing anything, run it, and see the exact problem, directly.

  4. Show a complete error message by copying and pasting it - starting from the line that says Traceback (most recent call last): all the way to the end - and formatting it the same way as the code (but in a separate block).