Computing
Computer Science LearnITWithMrC ⛯ Year 7 Year 8 Year 9 GCSE
Responsive image

Lesson Video

23

Lesson Tasks

  • Watch the Lesson video
    Make notes if needed.
  • Open your Learning Journal
    Complete Task 1 in your Learning Journal
  • Complete the learning activities
    Make sure you complete the book tasks in your Unit Booklet
  • Complete End of Task Assessment
    Update your learning objectives

What do I need to Learn?

0 results forGuest
I need to learn how to convert a string to an interger or real data type and visa versa.
I know how to find the length of a string.
I need to learn how to find a substring of a string
I need to learn how to find the position of a character in a string
I need to learn how to convert a string character to a character code and visa versa.

Key Terms

Strings Series of characters identifier Array of characters Substring String length Concatenation Substring

Task 1 - Getting organised Click to see more


Task: Learning Journal

Open your Learning Journal by clicking on the image below

Good notes will help you organise and process data and information

Task 1: Fill out your learning Journal.

Open your Learning Journal and complete the task below .


Task 2 - String manipulation Click to see more

Strings are bits of text. They can be defined as anything between quotes:

my_string = "I am a string" print(my_string)

To get a character from a string we use its index position (remember that the first character has the position 0):

my_string = "I am a string" print(my_string[4])


Task: Complete the tasks below and screenshot into your PowerPoint.

Create the string below :

my_word = "This is a string that contains characters"

  1. Add some code that prints out the 5th and 21st characters in the string above
  2. Add some code using a for loop that prints out the characters one at a time
  3. Add some code using a for loop that prints out the string backwards

  • When you are finished screenshot your code into your Learning Journal


  • Task 3 - Basic String Operations Click to see more

    Task: Click on the button below to find out more about string operations.

    Basic String Operations
    1. Read through all of the examples and run them to understand what they are showing you then complete the Exercise at the bottom of the page and screenshot the solution into your powerpoint
    2. Click on the button below and complete as many exercises as you can
    String exercises

  • When you are finished screenshot your code into your Learning Journal


  • Task 4 - Book Tasks Click to see more

    Task: Data Structures

    Open your student workbook at page 63 Read through the notes and complete the following tasks.
    1. Task 35
    2. Task 36


    Task 5 - Encryption Click to see more

    Task: Character Codes

    Open your student workbook at page 65 Read through the notes and then complete the following encryption task.

  • Convert the following steps into python code
    1. Prompt the user to enter a string to encrypt and an encryption key.
    2. Create an empty string to store the encrypted text.
    3. For each character in the original string:
    • Get the Unicode code value for the current character.
    • Add the encryption key to the code valuet.
    • Convert the new code value back to a character.
    • Add the encrypted character to the encrypted string.
  • Print the encrypted text to the console.

  • When you are finished screenshot your code into your Learning Journal


  • Task 6 - End of Task Assessment Click to see more