Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Analyse the micropython code below:
- message = 'ALARM'
- for letter in message:
- display.scroll(letter)
- signal_strengths = [-50,-49,-52,-48]
- for val in signal_strengths:
- display.scroll(str(val))
- mining_log = {'TR1': 198, 'TR2': 209}
- for key in mining_log:
- display.scroll(key)
- Students will be examined on the micropython code with a quiz which is represented in this format, your task will be to create a quiz in the exact same format on differnt code
- <grok-step>
- <grok-condition type="element-condition-completed" selector="#mc3"></grok-condition>
- What will be printed after running the following code?<br>
- `for letter in message:`<br>
- `| print(letter)`
- where `message = 'ALARM'`
- <grok-option-group id="mc3">
- <grok-option tip="Incorrect try again!">
- ALARMLMRA
- </grok-option>
- <grok-option correct tip="Correct!">
- A<br>
- L<br>
- A<br>
- R<br>
- M
- </grok-option>
- <grok-option tip="Incorrect try again!">
- ALARM
- </grok-option>
- <grok-option tip="Incorrect try again!">
- RMLA
- </grok-option>
- </grok-option-group>
- </grok-step>
- <grok-step>
- <grok-condition type="element-condition-completed" selector="#mc4"></grok-condition>
- How many times will the loop run in the following code?<br>
- `for val in signal_strengths:`<br>
- `| print(str(val))`
- where `signal_strengths = [-50,-49,-52,-48]`
- <grok-option-group id="mc4">
- <grok-option tip="Incorrect try again!">
- 2
- </grok-option>
- <grok-option correct tip="Correct!">
- 4
- </grok-option>
- <grok-option tip="Incorrect try again!">
- 5
- </grok-option>
- <grok-option tip="Incorrect try again!">
- 3
- </grok-option>
- </grok-option-group>
- </grok-step>
- <grok-step>
- <grok-condition type="element-condition-completed" selector="#mc5"></grok-condition>
- What will be printed after running the following code?<br>
- `for key in mining_log:`<br>
- `| print(key)`
- where `mining_log = {'TR1': 198, 'TR2': 209}`
- <grok-option-group id="mc5">
- <grok-option tip="Incorrect try again!">
- TR1: 198, TR2: 209
- </grok-option>
- <grok-option correct tip="Correct!">
- TR1<br>
- TR2
- </grok-option>
- <grok-option tip="Incorrect try again!">
- 198, 209
- </grok-option>
- <grok-option tip="Incorrect try again!">
- {'TR1': 198, 'TR2': 209}
- </grok-option>
- <grok-option tip="Incorrect try again!">
- 'TR1' 198, 'TR2' 209
- </grok-option>
- </grok-option-group>
- </grok-step>
- <grok-if show>
- <grok-condition type="element-condition-completed" selector="#mc7"></grok-condition>
- **Congratulations!**
- </grok-if>
- Can you generate a quiz for this code:
- Please respond in a code block and imitate the exact formatting and spacing of the quiz questions. Before asking the question quote a minimum amount of necessary code for the question
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement