lehrkraefte:snr:informatik:glf22:python:listen

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
lehrkraefte:snr:informatik:glf22:python:listen [2023/01/19 23:21]
Olaf Schnürer [Weiteres Material]
lehrkraefte:snr:informatik:glf22:python:listen [2023/11/21 12:37] (current)
Olaf Schnürer [Modifikation von Listen]
Line 271: Line 271:
   - Gib das 4. Element der Liste aus.   - Gib das 4. Element der Liste aus.
   - Entferne das letzte Element aus der Liste und gib es aus.   - Entferne das letzte Element aus der Liste und gib es aus.
-  - Gib die Liste aus (dies kannst du im Folgenden immer mal machen).+  - Gib die Liste aus (dies kannst du im Folgenden immer mal wieder als Test machen).
   - Füge die Zahlen 17, 42, 15, 42 und 91 hinten an die Liste an.   - Füge die Zahlen 17, 42, 15, 42 und 91 hinten an die Liste an.
   - Lösche das dritte Element aus der Liste und gib es aus.   - Lösche das dritte Element aus der Liste und gib es aus.
Line 540: Line 540:
 <code python saeulendiagramm.py> <code python saeulendiagramm.py>
 from matplotlib import pyplot from matplotlib import pyplot
-from math import * 
  
-xWerte = [i for i in range(-10, 11)] +xWerte = [i for i in range(-10, 30)] 
-yWerte = [cos(x*x) for x in xWerte]+yWerte = [(x-3)*(x+2)*(x-25) for x in xWerte]
 pyplot.bar(xWerte, yWerte, color='blue') pyplot.bar(xWerte, yWerte, color='blue')
 pyplot.show() pyplot.show()
Line 550: Line 549:
 <code python graph.py> <code python graph.py>
 from matplotlib import pyplot from matplotlib import pyplot
-from math import * 
  
-xWerte = [i for i in range(30)] +xWerte = [i for i in range(-10, 30)] 
-yWerte = [x*sin(x**3) for x in xWerte]+yWerte = [(x-3)*(x+2)*(x-25) for x in xWerte]
 pyplot.plot(xWerte, yWerte, color='blue') pyplot.plot(xWerte, yWerte, color='blue')
 pyplot.show() pyplot.show()
- 
 </code> </code>
  
  • lehrkraefte/snr/informatik/glf22/python/listen.1674166919.txt.gz
  • Last modified: 2023/01/19 23:21
  • by Olaf Schnürer