#need help shouldn't be hard for anyone basic python code

13 messages · Page 1 of 1 (latest)

proper star
#

getting stuck on the 5th exercise is kinda embarrassing , the code doesn't seem to work it was a little bit of a mess at the start but i really can't see a mistake with it help me

boreal rivet
#

What is the picture?

What tests are failing?

Increase your chance of getting help and look like a pro by sharing codeblocks not images. For example, you can type the following. Note, the ``` must be on their own line.
```python
for number in range(10):
total += number;
```
Discord will render that as so:

for number in range(10):
    total += number;

Notice the language after the first three backticks that allow the tool to give source highlighting.

proper star
#

its the melt down mitigation one

#

sorry i was absorbed reading the text again i got the first and last task i am still stuck on the second one

#

after reading it again i can tell that the key word is "float" but i don't know how to float in the middle of the equation

#
def is_criticality_balanced(temperature, neutrons_emitted):
    return temperature < 800 and neutrons_emitted > 500 and (temperature * neutrons_emitted) < 500000 
    
def reactor_efficiency(voltage, current, theoretical_max_power):
    percentage = (((float(voltage) * float(current))/float(theoretical_max_power))*100)
    if percentage >=80 :
        return 'Green'
    elif 60 <= percentage < 80:
        return 'orange'
    elif 30 <= percentage < 60:
        return 'red'
    else :
        return 'black'

def fail_safe(temperature, neutrons_produced_per_second, threshold):
    fper = (((temperature * neutrons_produced_per_second)/threshold)*100)
    if fper < 90:
        return 'LOW'
    elif 90 <= fper < 110 :
        return 'NORMAL'
    else :
        return 'DANGER' 
proper star
potent scroll
#

@proper star is there a test failure? What's the tests show?

proper star
#

i checked it and the problem was green was with a capital g

#

it is correct now

potent scroll
#

🎉

shrewd monolithBOT
#

If everything is resolved, we ask that the person who posted the request react to the top/original post with a :white_check_mark: (:white_check_mark:). This indicates to others that this issue has been resolved and locks the thread.
If all the tests pass and you want to further improve your solution, we encourage you to use the "Request a Code Review" feature on the website!