My result while trying to check:
:) fuel.py exists
:) input of 3/4 yields output of 75% - OK
:) input of 1/3 yields output of 33% - OK
:) input of 2/3 yields output of 67% - OK
:) input of 0/100 yields output of E - OK
:) input of 1/100 yields output of E - OK
:) input of 100/100 yields output of F - OK
:) input of 99/100 yields output of F - OK
**:( input of 100/0 results in reprompt - ERROR
expected program to reject input, but it did not**
:) input of 10/3 results in reprompt - OK
**:( input of three/four results in reprompt - ERROR
expected program to reject input, but it did not**
**:( input of 1.5/4 results in reprompt - ERROR
expected program to reject input, but it did not**
**:( input of 3/5.5 results in reprompt - ERROR
expected program to reject input, but it did not**
**:( input of 5-10 results in reprompt - ERROR
expected program to reject input, but it did not**
< /code>
Mein Code: < /p>
def main ():
final_fuel = get_percent()
percent_fuel = round(final_fuel * 100)
if percent_fuel = 99:
print("F")
else:
print(f"{percent_fuel}%")
def get_percent():
try:
while True:
fraction = input("Fuel Fraction: ")
x, y = fraction.split('/')
x = int(x)
y = int(y)
fuel = x/y
if fuel
Ich habe ein [url=viewtopic.php?t=19220]Problem[/url] mit dem Kraftstoffmesser CS50. Mein Code geht nur die Hälfte der Anforderungen durch. Kann mir jemand mit diesem helfen?[code]My result while trying to check:
:) fuel.py exists :) input of 3/4 yields output of 75% - OK :) input of 1/3 yields output of 33% - OK :) input of 2/3 yields output of 67% - OK :) input of 0/100 yields output of E - OK :) input of 1/100 yields output of E - OK :) input of 100/100 yields output of F - OK :) input of 99/100 yields output of F - OK **:( input of 100/0 results in reprompt - ERROR expected program to reject input, but it did not** :) input of 10/3 results in reprompt - OK **:( input of three/four results in reprompt - ERROR expected program to reject input, but it did not** **:( input of 1.5/4 results in reprompt - ERROR expected program to reject input, but it did not** **:( input of 3/5.5 results in reprompt - ERROR expected program to reject input, but it did not** **:( input of 5-10 results in reprompt - ERROR expected program to reject input, but it did not** < /code> Mein Code: < /p> def main (): final_fuel = get_percent() percent_fuel = round(final_fuel * 100) if percent_fuel = 99: print("F") else: print(f"{percent_fuel}%")
def get_percent(): try: while True: fraction = input("Fuel Fraction: ") x, y = fraction.split('/') x = int(x) y = int(y) fuel = x/y if fuel
Hier ist der Code:
@app.route( /buy , methods= )
@login_required
def buy():
Buy shares of stock
if request.method == GET :
return render_template( buy.html )
Ich habe eine VM auf der Google Cloud -Plattform erstellt. Nachdem ich es erstellt hatte, habe ich/etc/default/grub Datei bearbeitet, indem ich zusätzliche Kernel-Befehlszeilenparameter hinzugefügt...
Dieser Code führt eine Menge unnötiger Verarbeitung durch. Beispielsweise ist für die Nummer 3 eine ihrer Partitionen 1+1+1, aber es findet auch nach der ersten weiterhin „1+1+1“. Es gibt insgesamt...