String Manipulation

Lesson Instructions

Watch and follow the YouTube video, the lesson contains three parts:

  1. Key Information and content - all you need to do here is watch and listen. We recommend you take some notes for this one!

  2. Learning activity - You are to complete the activity, by completing crossword using string manipulation techniques.

  3. Consolidation - these are past exam question and are for deliberate practice to check your understanding.

Task - String Manipulation Activity

String Manipulation Activity

Task - Exam Questions - Deliberate Practice

Exam Questions - Web

Mark Scheme

Question 1

1 mark for each correct answer

  • firstName.length - 8

  • x - 7

  • username - PKtdinie

  • partName - triKa

Question 2

1 mark per bullet

  • Inputs for console, game name and release year

  • Extracts the first 3 characters of the console

  • Extracts the first 5 characters of the game name

  • Extracts the last 2 numbers of the year

  • Concatenates the different pieces of data together to form the ID

  • Outputs the result

Example solution:

console = input(“Enter the console”)

gameName = input(“Enter the game name”)

year = input(“Enter the release year”)

gameID = console.substring(0,3) + gameName.substring(0,5) + year.right(2)

print(gameID)