Browse Source

Initialization

master
Jonka Winkle 6 years ago
parent
commit
4714e039e2
7 changed files with 38 additions and 0 deletions
  1. 9
    0
      AB1_Aufg2.py
  2. 11
    0
      AB1_Aufg3.py
  3. 3
    0
      AB1_Aufg4.py
  4. 14
    0
      AB1_Aufg5.py
  5. BIN
      Arbeitsblatt01.pdf
  6. BIN
      Arbeitsblatt02.pdf
  7. 1
    0
      FirstProgram.py

+ 9
- 0
AB1_Aufg2.py View 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
- 0
AB1_Aufg3.py View 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
- 0
AB1_Aufg4.py View 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
- 0
AB1_Aufg5.py View 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 View File


BIN
Arbeitsblatt02.pdf View File


+ 1
- 0
FirstProgram.py View File

@@ -0,0 +1 @@
print("Es hat geklappt!")

Loading…
Cancel
Save