#Need help with solving these tasks

1 messages · Page 1 of 1 (latest)

magic flax
#

a) Create a python script that calculates the area of ​​the gray area.

b) Adjust the code in a) so that the user can enter/type in the length of the sides

c) what is the formula for the area of ​​the gray circle?

lavish pike
#

What have you tried?

magic flax
#

side = 10
areal_firkant = side * side
radius = side / 2
areal_sirkel = math.pi * radius*2
areal_grønn = areal_firkant - 2 areal_sirkel
prosent_grønn = (areal_grønn / areal_firkant) * 100

print(f"Arealet av det grønne området er {areal_grønn}")
print(f"{prosent_grønn}% av firkanten er grønn.")```

Its in norwegian, and its wrong
lavish pike
#

What is the formula for a circle's area given the radius?

magic flax
#

idk

#

im lost bruh

lavish pike
#

Do you know how to calculate the area of a circle?

magic flax
#

nope

lavish pike
#

Do you want to google it?

#

Because your area formula you used is incorrect

magic flax
#

can you fix it?

lavish pike
#

I can fix it but I won't fix it for you

#

If I do the work then you don't learn as effectively

magic flax
#

you fr?

lavish pike
#

yes

magic flax
#

how about u fix the code and explain

#

and show it to me