0
Correct the code python 3
Hi. I am just learning python and my first task were to write the small program that can count Alkohol in blood. I wrote these but my program has a lot of errors . Can someone help to correct it? https://code.sololearn.com/c9yVLI5PaN6L/?ref=app
2 Respuestas
+ 2
The code is written in German this is the reason why you cant understand it
+ 1
I don't understand how this program works, but I've saw some whole variables in quotes, so I thought this probably caused errors.
before:
def alkoholgehalt(getraenk): #alkohol in drink
if getraenk == "Bier": #beer
pAlkohol = 5.0
elif getraenk == "Starkbier":
pAlkohol = "8.0"
elif getraenk == "Biermix":
pAlkohol = "2.5"
elif getraenk == "Cognac":
pAlkohol = "38.0"
elif getraenk == "Wodka":
pAlkohol = "42.0"
return pAlkohol
after:
def alkoholgehalt(getraenk): #alkohol in drink
if getraenk == "Bier": #beer
pAlkohol = 5.0
elif getraenk == "Starkbier":
pAlkohol = 8.0
elif getraenk == "Biermix":
pAlkohol = 2.5
elif getraenk == "Cognac":
pAlkohol = 38.0
elif getraenk == "Wodka":
pAlkohol = 42.0
return pAlkohol