bin gerade dabei mich in Python einzuarbeiten und bin ein Totalanfänger..d.h. keine Progammiersprache bisher gelernt....
Warum gibt er mir nicht den Preis "6" aus?
Vielen Dank *schäm*
Code: Alles auswählen
def PacketB (preis, artikel):
cost = 6
item= 'nudel'
if (preis):
return cost
cost = 85
if (artikel):
return artikel
print PacketB(preis)
Traceback (most recent call last):
File "C:/Python26/test2.py", line 10, in <module>
print PacketB(preis)
NameError: name 'preis' is not defined