KPRIDE

Keywords

The code snippet below contains each of these key python programming concepts. Can you identify which line number they're on?
Being able to understand and use the right words to describe the code you're looking at helps you know what to search for and how to ask for help when you're writing your own code
Progress: assignment: setting the value of a variablebuilt-in subprogram: a type of pre-existing subprogram which you can use in python without having to import any modules or defining it yourself (e.g. input / print)character: individual symbol, letter or digit that forms part of a stringcomments: code is easier to read when each line or section of code is described in a way that helps other programmers understand what it doesindentation: code is easier to read when tabs or spaces are used to move blocks of code across to the right. This is necessary in python but optional in other programming languagesiteration: using FOR to loop through each value in a data structure (e.g. list or string)list: data structure which can grow or shrink to store as many values as required, keeping them in orderoutput: using print(...) to display a message to the userparameter: value passed into a subprogram which then behaves like a local variable for the scope of that subprogramread: loading data from a fileselection: using if to decide what to run next based on a boolean expressionstring: data structure which stores multiple characters in ordersubprogram call: part of the code which causes a subprogram to actually runvariable: named memory location which can store a value which can change when the program runswhitespace: code is easier to read when blank lines are used to break the code into logical paragraphs
Score: 0%

1/15: assignment

setting the value of a variable
Type in a line number where you can see this keyword in the python code then press check, or click on a line number
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

Predict

What do you think this program will output? What values do you think each variable will hold?
34
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

Write each prediction of what the program will output.

You can also predict variable values e.g. a = 10

Predict / Run

See how accurate your predictions were. Did the code behave as you expected?

Investigate

Experiment by editing the code.

Ideas:

  1. Try the program with different input data
  2. Run it line by line (Ctrl and full stop) to see how variables change.
  3. Read through the comments and see if there are any challenges to complete
  4. Change the values of some variables or constants and see how that affects the program
  5. Is there any input data that can crash the program?
  6. Change the logic of the program to make it do something different
  7. Add comments explaining what you've discovered

Debug

This code has been sabotaged with some common mistakes. Can you find and fix them all?

Click on the button to add 5 more errors to the code

Extend

Use your creativity along with what you've learned to create your own python project.

You get more points for each python skill you use from the keywords section

Click on "tests" to see a description of which python skills to aim for and keep track of which ones you've already used

You are not logged in