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 Both sides next revision
lehrkraefte:snr:informatik:glf22:python:listen [2022/10/25 21:15]
Olaf Schnürer [Aufgabe zum Listen-Erzeugen mit interner for-Schleife]
lehrkraefte:snr:informatik:glf22:python:listen [2023/01/19 23:21]
Olaf Schnürer [Weiteres Material]
Line 535: Line 535:
 </code> </code>
 </WRAP> </WRAP>
 +
 +===== Listen von Zahlen graphisch darstellen =====
 +
 +<code python saeulendiagramm.py>
 +from matplotlib import pyplot
 +from math import *
 +
 +xWerte = [i for i in range(-10, 11)]
 +yWerte = [cos(x*x) for x in xWerte]
 +pyplot.bar(xWerte, yWerte, color='blue')
 +pyplot.show()
 +</code>
 +
 +<code python graph.py>
 +from matplotlib import pyplot
 +from math import *
 +
 +xWerte = [i for i in range(30)]
 +yWerte = [x*sin(x**3) for x in xWerte]
 +pyplot.plot(xWerte, yWerte, color='blue')
 +pyplot.show()
 +
 +</code>
  
 ===== Weiteres Material ===== ===== Weiteres Material =====
  • lehrkraefte/snr/informatik/glf22/python/listen.txt
  • Last modified: 2023/11/21 12:37
  • by Olaf Schnürer