@@ -0,0 +1,9 @@ | |||
def x_hoch_y(x, y): | |||
return x**y | |||
#alternativ: return pow(x,y) | |||
print("13 hoch 7 ist: ", x_hoch_y(13,7)) | |||
print("2 hoch 9 ist: ", x_hoch_y(2,9)) | |||
print("4 hoch 2 ist: ", x_hoch_y(4,2)) |
@@ -0,0 +1,11 @@ | |||
listA = [2, 4.4, "HiHi", 15, 6.97] | |||
listB = [12, 82, "BlaBla"] | |||
listC = listA + listB | |||
print("listC: ", listC) | |||
listC.reverse() | |||
print("listC reverse: ", listC) | |||
#print("listC sort: ", listC.sort()) |
@@ -0,0 +1,3 @@ | |||
print("Das Eis kostet %.2f Euro" % ( 1.8 ) ) | |||
print("Die Vorlesung startet um %2d:%2d Uhr" % ( 9, 45 )) | |||
print("Die Vorlesung startet um %02d:%02d Uhr" % ( 9, 45 )) |
@@ -0,0 +1,14 @@ | |||
myData = {"first":"Jonka", "last":"Winkle", "day":10, "month":11, "year":1995} | |||
print("Ganzer Name: ", myData["first"], myData["last"]) | |||
print("Geburtsdatum: ", myData["day"], myData["month"], myData["year"]) | |||
def geburtstag(dictio): | |||
returnStr = str(dictio["day"]) + "." + str(dictio["month"])+ "." + str(dictio["year"]) | |||
#alternativ: returnStr = "{:02d}.{:02d}.{:04d}".format(dictio["day"], dictio["month"], dictio["year"]) | |||
return returnStr | |||
print("Hier das Ergebnis der geburtstag()-Fkt: ", geburtstag(myData)) |
@@ -0,0 +1 @@ | |||
print("Es hat geklappt!") |