Tutorial A7

1 Create an empty list and fill it iteratively with even numbers from 2 to 12 converted to floats.

2 Consider again the discrete potential function from the lesson. Find out if the function has a potential energy minimum and print out the \(x\)-value of the minimum if you found one.

[1]:
x = list(range(-10, 11))
E = [x**2 - 2 for x in x]
print("x: ", x)
print("E: ", E)
x:  [-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
E:  [98, 79, 62, 47, 34, 23, 14, 7, 2, -1, -2, -1, 2, 7, 14, 23, 34, 47, 62, 79, 98]

3 Given an integer n compute the factorial of this number.

Advanced 1 Take the following dummy text and create a dictionary that has the occurring letters (characters) as keys and the corresponding letter counts as values (example below).

"""As any dedicated reader can clearly see, the Ideal of practical reason is a representation
of, as far as I know, the things in themselves; as I have shown elsewhere, the phenomena
should only be used as a canon for our understanding. The paralogisms of practical
reason are what first give rise to the architectonic of practical reason. As will easily be
shown in the next section, reason would thereby be made to contradict, in view of these
considerations, the Ideal of practical reason, yet the manifold depends on the phenomena.
Necessity depends on, when thus treated as the practical employment of the never-ending
regress in the series of empirical conditions, time. Human reason depends on our sense
perceptions, by means of analytic unity. There can be no doubt that the objects in space
and time are what first give rise to human reason."""
[2]:
# Example for count dict
counts = {
    "a": 12,
    "b": 1
}