diff --git a/python/s1/s1_a1_3.pdf b/python/s1/s1_a1_3.pdf new file mode 100644 index 0000000..a54ce53 Binary files /dev/null and b/python/s1/s1_a1_3.pdf differ diff --git a/python/s1/s1_a51.py b/python/s1/s1_a51.py new file mode 100644 index 0000000..f2422cb --- /dev/null +++ b/python/s1/s1_a51.py @@ -0,0 +1,4 @@ +import numpy as np +a=np.array([[3,0,-2,11],[0,0,9,0],[0,7,0,0],[0,0,0,-3]]) + +print(a) \ No newline at end of file diff --git a/python/s1/s1_a52.pdf b/python/s1/s1_a52.pdf new file mode 100644 index 0000000..7d41b96 Binary files /dev/null and b/python/s1/s1_a52.pdf differ diff --git a/python/s1/s1_a53_6.py b/python/s1/s1_a53_6.py new file mode 100644 index 0000000..79da687 --- /dev/null +++ b/python/s1/s1_a53_6.py @@ -0,0 +1,48 @@ +print("Aufgabe 3:") + +liste = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + +print("Liste: ", liste) + +a = liste[-1] +b = liste[-2] +c = liste[-3] + +liste = [a] + liste +liste = [b] + liste +liste = [c] + liste + +for x in range(3): + liste.pop(-1) + +print("Liste neu:", liste) + +print() +print("Aufgabe 4:") + +strings="Donaudampfschiffahrtsgesellschaftsstewardess" +x=list(strings) + +resultantList = [] + +print(x) + +print("Länge der Liste:", len(x)) + +for element in strings: + if element not in resultantList: + resultantList.append(element) + +print(resultantList) + +print("Länge der Liste ohne Duplikate:", len(resultantList)) + +print() +print("Aufgabe 5:") + +def sort(sub_li): + sub_li.sort(key = lambda x: x[1]) + return sub_li + +sub_li =[[1, 2, 3], [2, 1, 3], [4, 0, 1]] +print(sort(sub_li)) \ No newline at end of file diff --git a/python/s1/s1_a61_2.py b/python/s1/s1_a61_2.py new file mode 100644 index 0000000..0ad379a --- /dev/null +++ b/python/s1/s1_a61_2.py @@ -0,0 +1,9 @@ +s = "This is a test" +new_s = s.replace(' ','-') +print(new_s) + +s1 = "Hello, World" + +s1split = s1.split(",") + +print(''.join(reversed(s1split))) \ No newline at end of file diff --git a/python/s2/README b/python/s2/README new file mode 100644 index 0000000..e69de29