Lesson details

Key learning points

  1. In this lesson, we will understand the rules of operator precedence when evaluating arithmetic expressions. We will be reminded of BIDMAS, before investigating code that uses various arithmetic expressions. This lesson will prepare us for the next lesson, where we will begin to use conditions in programming.

Licence

This content is made available by Oak National Academy Limited and its partners and licensed under Oak’s terms & conditions (Collection 1), except where otherwise stated.

Loading...

4 Questions

Q1.
True or False: Pseudorandom number generation uses mathematical algorithms which are computer-generated and therefore highly predictable.
False
Correct answer: True
Q2.
If you want to comment on your code over multiple lines, what syntax should you use?
Correct answer: ''' ''' 3 x quotation marks at the start and the end
" " A single speech mark at the start and the end
# A hashtag at the start and another # at the end
Q3.
When using the function randrange(1,5,2), what is the third value in the brackets used for?
The maximum value
The minmum value
Correct answer: The step value
Q4.
When using the function randrange(1,5,2), what is the second value in the brackets used for?
Correct answer: The maximum value
The minmum value
The step value

4 Questions

Q1.
What is the evaluation of this expression: 10 * 10 / 5
100
2
Correct answer: 20
50
Q2.
What is the evaluation of this expression: 5 - 2 + 6 / 2
3
4.5
Correct answer: 6
9
Q3.
If you were using integer division, what would be the evaluation of this expression: 14//3
2
Correct answer: 4
42
5
Q4.
If you were using modulo, what would be the evaluation of this expression: 14%3
1
Correct answer: 2
3
42