< Kurs:Python < LG < Py2009
Beispiele aus der Physik ;-)
Ohmsches Gesetz
# R = U / I
def Widerstand (Spannung, Stromstaerke):
Widerstand = 1.0 * Spannung / Stromstaerke
return Widerstand
Spannung = input("Geben Sie die Spannung ein: ")
Stromstaerke = input("Geben Sie die Stromstaerke ein: ")
print "Der Widerstand betraegt", Widerstand (Spannung, Stromstaerke), "Ohm."
Testmöglichkeit: Aufgaben zum Thema mit Beispielwerten
This article is issued from Wikiversity. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.