Dennis Krämer 2022-11-08 15:31:55 +01:00
commit b27818ced1
5 changed files with 88 additions and 0 deletions

11
.project 100644
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>PR3_Steinberger</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>

BIN
s1_a1_3.pdf 100644

Binary file not shown.

BIN
s1_a52.pdf 100644

Binary file not shown.

60
s1_a53_6.py 100644
View File

@ -0,0 +1,60 @@
#Aufgabe 5.3
liste1 = [1,2,3,4,5,6,7,8,9,10]
l = liste1[len(liste1)-3 : len(liste1)]
for i in range(1,4):
x = liste1.pop()
liste1.insert(0, x)
print(liste1)
#Aufgabe 5.4
from xmlrpc.client import boolean
from pickle import TRUE
list1 = []
string1 = "Donaudampfschifffahrtsgesellschaft".lower()
list1.extend(string1)
count = 0
print("Laenge der Liste vorher: ", len(list1))
i = 0
while i < len(list1):
element = list1[i]
count = list1.count(element)
if count > 1:
i = 0
for j in range(1,count+1):
list1.remove(element)
else:
i = i+1
print("Laenge der Liste nachher: ", len(list1))
#Aufgabe 5.5
list1 = [[1,2,3],[2,1,3],[4,0,1]]
i = 0
while i < len(list1)-1:
save_string = list1[i]
if list1[i+1][1] < list1[i][1]:
list1[i] = list1[i+1]
list1[i+1] = save_string
i = 0
else:
i = i+1
print(list1)
#Aufgabe 5.6
geraeusch = {
"Hund" : "Wuff",
"Katze":"Miau",
"Esel" : "Ia"
}
def tier_geraeusch(tiername):
print(geraeusch[tiername])
tier_geraeusch("Hund")

17
si_a4.py 100644
View File

@ -0,0 +1,17 @@
from cmath import pi
END_CONDITION = (pi**2)/6
sum = 0
i = 1
counter = 0
while(True):
sum = sum + (1/(i**2))
if('%.6f'%sum == '%.6f'%END_CONDITION):
print('%.6f'%sum)
break
i = i+1
counter = counter +1
print('Anzahl der Iterationen: ', counter)