Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Quiz: Selektionen, if-else ====== <quizlib id="quiz" rightanswers="[['a0'], ['a3'], ['a3']]" submit="Check Answers"> <question title="Welchen Wert hat X nach dem Ausführen des folgenden Codes? <pre>x = 0 <br>a = 0 <br>b = -5 <br>if a > 0: <br> if b < 0: <br> x = x + 5 <br> elif a > 5: <br> x = x + 4 <br> else: <br> x = x + 3 <br>else: <br> x = x + 2 <br>print(x) <br>" type="radio">2|0|3|4</question> <question title="Welchen Wert hat X nach dem Ausführen des folgenden Codes? <pre>x = 0 <br>a = 5 <br>b = 5 <br>if a > 0: <br> if b < 0: <br> x = x + 5 <br> elif a > 5: <br> x = x + 4 <br> else: <br> x = x + 3 <br>else: <br> x = x + 2 <br>print(x) <br>" type="radio">0|4|2|3</question> <question title="Was wird nach dem Ausführen des Programms auf der Konsole stehen?<pre>x = 3 <br>if ( x == 0 ):<br> print ("Am I here?")<br>elif ( x == 3 ):<br> print ("Or here?")<br>print ("Or over here?")" type="radio">Am I here?|Or here?|Am I here? Or here?|Or here? Or over here?|Am I here? Or over here?</question> </quizlib> lehrkraefte/blc/informatik/glf20/programmieren/if-else-quiz.txt Last modified: 2020/10/30 08:05by mirco.triner