Beruflich Dokumente
Kultur Dokumente
November 8, 2021
0.1 Aufgabe 2
0.1.1 Benennen Sie vier verschiedene Datentypen und geben Sie jeweils ein Beispiel
an.
Text Type, String text = “String variable” Numeric Type, integer number = 15 Sequence Type, list
cities = [ “Berlin”, “Paris”, “London”, “Istanbul” ] Boolische Type, bool birolHatPythonKurseBe-
standen = true
0.1.3 Was passiert wenn man versucht eine Variable vom Typ float durch eine Vari-
able vom Typ String zu teilen?
Wir bekommen TypeError.
TypeError: unsupported operand type(s) for /: ‘float’ and ‘str’
Es sagt wir können nicht nutzen diese operant “/” zwischen float und string.
0.2 Aufgabe 3
[15]: import math
[16]: '''
Funktion berechnet die Normalverteilung.
param x = x
param y = mikron
param z = sigma
'''
def f(x, y, z):
return (1/(y*math.sqrt(2*math.pi)))*math.exp((-1/2)*((x-z)/y)**2)
print(f(5.5, 1.0, 4.0))
0.12951759566589174