diff --git a/AB1_Aufg2.py b/AB1_Aufg2.py new file mode 100644 index 0000000..1e4e89b --- /dev/null +++ b/AB1_Aufg2.py @@ -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)) diff --git a/AB1_Aufg3.py b/AB1_Aufg3.py new file mode 100644 index 0000000..ec46983 --- /dev/null +++ b/AB1_Aufg3.py @@ -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()) diff --git a/AB1_Aufg4.py b/AB1_Aufg4.py new file mode 100644 index 0000000..0e8cffa --- /dev/null +++ b/AB1_Aufg4.py @@ -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 )) diff --git a/AB1_Aufg5.py b/AB1_Aufg5.py new file mode 100644 index 0000000..6edcf56 --- /dev/null +++ b/AB1_Aufg5.py @@ -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)) diff --git a/Arbeitsblatt01.pdf b/Arbeitsblatt01.pdf new file mode 100644 index 0000000..43ada89 Binary files /dev/null and b/Arbeitsblatt01.pdf differ diff --git a/Arbeitsblatt02.pdf b/Arbeitsblatt02.pdf new file mode 100644 index 0000000..87613e3 Binary files /dev/null and b/Arbeitsblatt02.pdf differ diff --git a/FirstProgram.py b/FirstProgram.py new file mode 100644 index 0000000..a6528a2 --- /dev/null +++ b/FirstProgram.py @@ -0,0 +1 @@ +print("Es hat geklappt!") \ No newline at end of file