

2.2 String Manipulation
Presentation
•
Computers
•
10th Grade
•
Practice Problem
•
Medium
Leah Tomlinson
Used 9+ times
FREE Resource
11 Slides • 4 Questions
1
2.2 String Manipulation
Work through the slides and questions independently, then complete the tasks attached to the assignment in google classroom.

2
Multiple Choice
Which of the following code is a function?
def addition(num1, num2):
total = num1 + num2
print(total)
#main program
addition(3,6)
def addition(num1, num2):
total = num1 + num2
return total
#main total
sum = addition(3,6)
print(sum)
3
Multiple Choice
What is the difference between a procedure and a function?
A function has parameters a procedure does not
A function contains calculations a procedure does not
A function needs to return a value to the main program a procedure does not
4
Sometimes when programming we want to chop and change our strings to meet the needs of the program. For example, you might have an input which asks a user for their first and last name. The program you develop might need that input to be split into two separate variables, Python has string manipulation tools which allow us to do this.
5
Above are the different ways we can manipulate strings to suit our program needs. You may have used some of them before in programming or they could be completely new to you. I have included a link to a website which shows you how to use each of them in python.
6
Complete this task, open the presentation posted in Google Classroom, you need to match the first sets of code to an alternative way of writing it and then match it to the description of what it does.
7
Multiple Choice
When wanting to find the length of a string, which code would you use?
length(string)
length = string.length
length = len(string)
8
Multiple Choice
What would the code 'name.substring(3,5)' return?
5 characters in the string starting from the 3rd
3 characters in the string starting from the 5th
The 3rd to the 5th character in the string
9
Here we have an example of a string "Freda Smith", in the table at the bottom. Here we have first taken a substring starting at position 1 and ending in position 3 resulting in the string "RED". In the second example we are trying to find the location of "S", so the function will search the string find the index and return it. Finally, we use the length function to find how long the string is, in this example "11"
10
Complete the task posted in the assignment, for this task you need to say what the output would be using the string for each line of code/
11
ASCII is an internationally used character set which gives every character its own unique binary code using up to 32 bits. The function ASC("A") would return the decimal number the character represents, in this case 65. The "A" can be substituted for any number. The CHR(66) function will do the opposite, again "66" can be substituted for any number.
12
For this task you need to work through the algorithm to identify what the value of each variable will be when the algorithm has completed.
13
There are 5 tasks which require you to complete string manipulation, some of them just require you to fill in the blanks and others require you to write the full algorithm. These can be written using Python just ensure that all syntax is correct.
14
Final task is some exam style questions on String manipulation, ensure you consider the number of marks available when writing your answer. They are all algorithm questions and so again Syntax will need to be as accurate as possible if writing in Python.
15
The tasks discussed are due in today (Wednesday 20th) you should have also completed and uploaded the tasks from Mondays lesson - subprograms.
2.2 String Manipulation
Work through the slides and questions independently, then complete the tasks attached to the assignment in google classroom.

Show answer
Auto Play
Slide 1 / 15
SLIDE
Similar Resources on Wayground
10 questions
presentacion sobre vue.js
Presentation
•
10th Grade
13 questions
Polynomial Multiplication
Presentation
•
10th Grade
10 questions
Analyzing Influences
Presentation
•
10th Grade
12 questions
Relationships Within Triangles
Presentation
•
10th Grade
12 questions
Action and State Verbs
Presentation
•
10th Grade
12 questions
Anne Frank Character Change
Presentation
•
6th - 9th Grade
9 questions
Limiting Reactant and Percent Yield
Presentation
•
10th Grade
11 questions
Reading News Online
Presentation
•
5th Grade
Popular Resources on Wayground
25 questions
The Ultimate College Knowledge Quiz
Quiz
•
8th Grade
20 questions
Math Review
Quiz
•
3rd Grade
15 questions
Fast food
Quiz
•
7th Grade
20 questions
Math Review
Quiz
•
6th Grade
20 questions
Context Clues
Quiz
•
6th Grade
20 questions
Inferences
Quiz
•
4th Grade
19 questions
Classifying Quadrilaterals
Quiz
•
3rd Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Computers
10 questions
Fact Check Ice Breaker: Two truths and a lie
Quiz
•
5th - 12th Grade
40 questions
Math Large Group Session 1
Quiz
•
9th - 12th Grade
14 questions
Attributes of Linear Functions
Quiz
•
9th - 12th Grade
100 questions
NC Biology EOC Review
Quiz
•
9th - 10th Grade
15 questions
Memorial Day Trivia
Quiz
•
KG - 12th Grade
21 questions
Hidden Figures
Quiz
•
6th - 12th Grade
20 questions
Scatter Plots, Lines of Best Fit, Sampling
Quiz
•
9th - 11th Grade
20 questions
Food Chains, Food Webs, and Ecological Pyramids
Quiz
•
9th - 10th Grade