Initialization
This commit is contained in:
parent
a07017078a
commit
4714e039e2
9
AB1_Aufg2.py
Normal file
9
AB1_Aufg2.py
Normal file
@ -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))
|
11
AB1_Aufg3.py
Normal file
11
AB1_Aufg3.py
Normal file
@ -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())
|
3
AB1_Aufg4.py
Normal file
3
AB1_Aufg4.py
Normal file
@ -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 ))
|
14
AB1_Aufg5.py
Normal file
14
AB1_Aufg5.py
Normal file
@ -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))
|
BIN
Arbeitsblatt01.pdf
Normal file
BIN
Arbeitsblatt01.pdf
Normal file
Binary file not shown.
BIN
Arbeitsblatt02.pdf
Normal file
BIN
Arbeitsblatt02.pdf
Normal file
Binary file not shown.
1
FirstProgram.py
Normal file
1
FirstProgram.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
print("Es hat geklappt!")
|
Loading…
x
Reference in New Issue
Block a user