I would like some HELP!!
I want to make a simple noob function before put into my django project.
I want a function that provides the lamp power of a room.
Input: The room's area (m²)
Output: The lamp power (W).
The rules of this math is:
If the entry area is <= 6m² then the power will be 100W (easy).
If the area is > 6m² then for the first 6m² the power is 100W, BUT for the next 4m² is added 60W to the lamp power.
Ex: Area = 20m²
6m² + 4m² + 4m² + 4m² + 2m² = 20 m²
100 + 60 + 60 + 60 + 0** = 280 W
**(less than exact 4m² doesn't count)
I want to make a simple noob function before put into my django project.
I want a function that provides the lamp power of a room.
Input: The room's area (m²)
Output: The lamp power (W).
The rules of this math is:
If the entry area is <= 6m² then the power will be 100W (easy).
If the area is > 6m² then for the first 6m² the power is 100W, BUT for the next 4m² is added 60W to the lamp power.
Ex: Area = 20m²
6m² + 4m² + 4m² + 4m² + 2m² = 20 m²
100 + 60 + 60 + 60 + 0** = 280 W
**(less than exact 4m² doesn't count)
def light(area): power = 0 if area < 6: power = 100 else: ........ #testing print(luz(20))Any help to make this simple code would be AWESOME!