Both sides previous revision
Previous revision
Next revision
|
Previous revision
|
lehrkraefte:blc:informatik:glf20:programmieren:io-and-vars [2020/09/18 09:20] Ivo Blöchliger [Das erste Programm] |
lehrkraefte:blc:informatik:glf20:programmieren:io-and-vars [2020/09/23 08:45] (current) Ivo Blöchliger |
Führen Sie das Programm aus. | Führen Sie das Programm aus. |
| |
[[https://fginfo.ksbg.ch/~ivo/videos/informatik/python/tiger-jython-hello-world.mp4|Erklär-Video dazu]] und noch auf [[https://web.microsoftstream.com/video/1748a15f-4eac-4bf6-b2ec-fccc51383855|Stream]] | [[https://fginfo.ksbg.ch/~ivo/videos/informatik/python/tiger-jython-hello-world.mp4|🎞▶️Erklärvideo dazu]] und noch auf [[https://web.microsoftstream.com/video/1748a15f-4eac-4bf6-b2ec-fccc51383855|Stream]] |
</WRAP> | </WRAP> |
===== Ausgabe und Arithmetische Ausdrücke ===== | ===== Ausgabe und Arithmetische Ausdrücke ===== |
</code> | </code> |
Erweitern Sie Ihr Programm so, dass Sie in der ersten Zeile mit einer Variablen die Grösse (Anzahl kleiner Quadrätchen) des Text-Quadrats beliebig wählen können. | Erweitern Sie Ihr Programm so, dass Sie in der ersten Zeile mit einer Variablen die Grösse (Anzahl kleiner Quadrätchen) des Text-Quadrats beliebig wählen können. |
| |
| [[https://fginfo.ksbg.ch/~ivo/videos/informatik/python/tiger-jython-text-gitter-quadrat.mp4|🎞▶️ Erklärvideo]] oder auch auf [[https://web.microsoftstream.com/video/7e14fc58-02f0-41fc-8d79-ce4c0a33dc4a|Stream]] |
| |
</WRAP> | </WRAP> |
| |
[[https://docs.python.org/2/library/stdtypes.html#string-formatting|Hier noch die offizelle Dokumentation]]. In Python3 wird zwar noch eine andere Variante mit ''.format()'' empfohlen. Die hier präsentierte Variante ist aber so in fast allen Programmiersprachen möglich. | [[https://docs.python.org/2/library/stdtypes.html#string-formatting|Hier noch die offizelle Dokumentation]]. In Python3 wird zwar noch eine andere Variante mit ''.format()'' empfohlen. Die hier präsentierte Variante ist aber so in fast allen Programmiersprachen möglich. |
| |
[[https://fginfo.ksbg.ch/~ivo/videos/informatik/python/tiger-jython-format-modulo.mp4|Erklärvideo dazu]] und dasselbe auf [[https://web.microsoftstream.com/video/83e8e81f-b732-4ecf-b978-0f6bb5cc6490|Stream]] | [[https://fginfo.ksbg.ch/~ivo/videos/informatik/python/tiger-jython-format-modulo.mp4|🎞▶️Erklärvideo dazu]] und dasselbe auf [[https://web.microsoftstream.com/video/83e8e81f-b732-4ecf-b978-0f6bb5cc6490|Stream]] |
</WRAP> | </WRAP> |
| |
===== Quiz ===== | ===== Quiz ===== |
| |
<quizlib id="quiz" rightanswers="['12', '42', ['a1'],'007', '0.67']" submit="Check Answers"> | [[:io-and-vars:quiz|Quiz]] |
<question title="Was ist die Ausgabe von <pre>print(5+1*8-1)</pre>" type="text"></question> | |
<question title="Was ist die Ausgabe von <pre>print((5+1)*(8-1))</pre>" type="text"></question> | |
<question title='Welche Ausgabe produziert <pre>print(("a"*3+"b"*2)*2)</pre>' type="radio">aaabbbb|aaabbaaabb|a3b22|("a"*3+"b"*2)*2</question> | |
<question title="Was ist die Ausgabe von <pre>print("%03d" % 7.92)</pre>" type="text"></question> | |
<question title="Was ist die Ausgabe von <pre>a=2
b=3
print("%.2f" % (a/b))</pre>" type="text"></question> | |
</quizlib> | |
| |
====== Lösungsvorschläge ====== | ====== Lösungsvorschläge ====== |