Back to String Handling Operations In A Programming
N
Oak National Academy
Lessons written by expert teachers in England, each with slides, a video and quizzes.
- Their topic:
- Programming: strings and lists
- For your topic:
- String Handling Operations In A Programming · Computer Science - 9210
Use these lessons alongside our lesson note, which covers your syllabus in full.
What this covers in your syllabus
-
Understand and be able to use:
Not covered here. Our lesson note covers it.
-
-
-
-
-
convert character to character code
Not covered here. Our lesson note covers it.
-
convert character code to character
Not covered here. Our lesson note covers it.
-
3 lessons from Oak National Academy
Lesson 1 of 3 · GCSE level, ages 14 to 16
String handling
By the end:
I can use string handling techniques to find things out about a string.
Key learning points
- A string is a collection of characters.
- String handling is using techniques and built-in functions to find out information about strings.
- The len() function is used to return the length of a string.
- The index number is used to retrieve a single character from a specified position in a string.
- For loops can be used to iterate through some or all of the items in a string.
Keywords
- string handling
- how programs manipulate text through operations like joining, searching and formatting
- index
- the location of items or elements in a list, array or string
- for loop
- an iterative statement that will repeat for the length of a given sequence
A common mistake
Mistake: Operations in programs can only be performed on numbers.
In fact: Operations can be performed on different types of data. What the operator does can change depending on the data type it is being used with.
Check what you learned
From Oak National Academy's exit quiz. Choose every answer that is right.
A computing lesson by Oak National Academy licensed under the Open Government Licence (OGL) v3.0.
Read the licence
Lesson 2 of 3 · GCSE level, ages 14 to 16
String manipulation
By the end:
I can create a program using string handling techniques.
Key learning points
- The contents of a string can be validated.
- The random module can be used to generate random numbers and pick random letters from a string.
- Concatenation is a way of joining strings using the + operator to make a new string.
- Strings can be manipulated using the upper() and lower() string methods to convert the string into upper- or lowercase.
Keywords
- random
- a module that can generate random numbers, pick random items or shuffle a list
- concatenation
- the process of joining strings together to create a new string
- lower()
- a string method that converts all letters in a string to lowercase
- upper()
- a string method that converts all letters in a string to uppercase
A common mistake
Mistake: The random module will only generate random numbers.
In fact: The random module can generate random characters as well as numbers.
Check what you learned
From Oak National Academy's exit quiz. Choose every answer that is right.
A computing lesson by Oak National Academy licensed under the Open Government Licence (OGL) v3.0.
Read the licence
Lesson 3 of 3 · GCSE level, ages 14 to 16
Substrings
By the end:
I can slice a string to create a substring and then use list methods on the substring.
Key learning points
- A substring is a part of a string.
- Slicing can be used to separate a string into substrings.
- ASCII is a character set used to represent all of the characters on a standard American or English keyboard.
Keywords
- substring
- part of a string
- slice
- the process of extracting a specific substring
- ASCII
- a character set that represents each character with a unique numerical value
A common mistake
Mistake: Indexing starts at 1 as that is the location of the first element.
In fact: In Python, and many other programming languages, indexing starts at 0.
Check what you learned
From Oak National Academy's exit quiz. Choose every answer that is right.
A computing lesson by Oak National Academy licensed under the Open Government Licence (OGL) v3.0.
Read the licence
The wording comes from each publisher. The layout and the links to your syllabus are ours.