Starter quiz
- Match the term to its definition.
- index⇔the location of an item in a list ✓
- mutable⇔able to be changed ✓
- string⇔a data type that is a collection of characters ✓
- list⇔a collection of data in a particular sequence ✓
- remove⇔take an item away from a list ✓
- operator⇔a symbol for a specific calculation ✓
- What does the append method do in Python?
- removes an item from a list
- sorts a list in alphabetical order
- adds an item to the end of a list ✓
- finds the index of an item
-
- What is the term for repeating a sequence of instructions?
- 'Iteration' ✓
- What is a for loop used for?
- to perform a single operation
- to iterate through a list a specific number of times ✓
- to iterate through a list as long as a condition is met
- to stop the execution of a program
-
- What is a floating-point number in Python?
- an integer value
- a sequence of characters
- a number with a decimal point ✓
- a Boolean value
-
- How are lists defined in Python?
- using angle brackets < >
- using parentheses ( )
- using curly braces { }
- using square brackets [ ] ✓
-
Exit quiz
- Put these steps in order to represent the software development life cycle.
- 1⇔planning
- 2⇔analysis
- 3⇔design
- 4⇔development
- 5⇔testing
- 6⇔implementation
- What is the primary purpose of the analysis phase in the software development life cycle?
- to write code for the software
- to identify and document the requirements of the project ✓
- to test the software for bugs
- to deploy the software to users
-
- Which data type allows for fractional values in Python?
- integer
- Boolean
- string
- floating-point ✓
-
- How do you use the `round()` function to round the number 3.14159 to two decimal places in Python?
- 'round(3.14159, 2)' ✓
- How do you access the third item in a list called myList in Python?
- `myList[2]` ✓
- `myList[3]`
- `myList[1]`
- `myList[0]`
-
- How do you iterate through each item in a list called myList using a for loop in Python? Hint: Use the variable 'item'.
- 'for item in myList:' ✓
Worksheet
Loading worksheet ...
Presentation
Loading presentation ...
Video
Lesson Details
Key learning points
- Data can be used to investigate a problem.
- Programming tools can be used to perform investigations on data held in data structures.
- When investigating a problem using code, it is useful to follow the software development life cycle.
- Data structures, iteration and operations can be combined to make more complex programs in Python.
Common misconception
Python will automatically round numbers to the nearest whole number.
Python will perform calculations based on the values that have been provided and generate an answer that can include fractional parts. If you want to reduce the number of digits, you can use the round() function.
Keywords
Investigate - examine data carefully to find out the truth about something
Rounding - reducing the number of digits in a number by examining the digits that follow that will be discarded
+