
Higher SDD - Pre-defined functions
Presentation
•
Computers
•
8th Grade
•
Practice Problem
•
Easy
G Alexander-Doyle
Used 4+ times
FREE Resource
16 Slides • 6 Questions
1
2
Aims
We are learning how to use pre-defined functions with parameters in Python. Specifically, to know how to use the ORD, CHR, INT and MODULUS functions.
We are learning how to isolate parts of a string in Python.
Achievements (practical)
I can use a pre-defined function to isolate part of a string.
I can use the ORD pre-defined function to convert a character to its corresponding ASCII code.
I can use the CHR pre-defined function to convert an ASCII code into its corresponding character.
I can use the INT function to convert a floating-point number to an integer.
I can use the MODULUS operator to find the remainder of a division.
3
4
5
6
7
Multiple Choice
A competition was run to suggest names for a new bridge. The 20 most popular bridge names have been identified and stored.
State the predefined function that should be used to select any one of the 20 stored bridge names as the winner.
length
random
round
square
8
Open Ended
Three candidates have received the same number of votes in an election. Their names are stored in a data structure called winners. The app uses a predefined function to pick one candidate from winners. Using a programming language of your choice, write the code that will display the name of the winning candidate.
9
import random
winningIndex = (random.randint(0,2))
print(winners[winningIndex])
One mark for the following code:
random
correct parameters
random number used as winners array index
10
11
12
13
14
15
16
Fill in the Blanks
What would the output be from the following line of code?
print(15%4)
Type answer...
17
Multiple Choice
What would the output be from this program?
High
Hig
igh
e
18
Multiple Choice
What would the output be from this program?
Com
er
her
put
19
20
21
Match
Match the following pre-defined functions.
ORD
CHR
INT
MOD
Returns the ASCII value of a character
Returns the character of an ASCII value
Returns an integer part of a real number
Returns the remainder of a divsion
Returns the ASCII value of a character
Returns the character of an ASCII value
Returns an integer part of a real number
Returns the remainder of a divsion
22
Aims
We are learning how to use pre-defined functions with parameters in Python. Specifically, to know how to use the ORD, CHR, INT and MODULUS functions.
We are learning how to isolate parts of a string in Python.
Achievements (practical)
I can use a pre-defined function to isolate part of a string.
I can use the ORD pre-defined function to convert a character to its corresponding ASCII code.
I can use the CHR pre-defined function to convert an ASCII code into its corresponding character.
I can use the INT function to convert a floating-point number to an integer.
I can use the MODULUS operator to find the remainder of a division.
Show answer
Auto Play
Slide 1 / 22
SLIDE
Similar Resources on Wayground
17 questions
Computer Software
Presentation
•
7th Grade
15 questions
Logic Gates
Presentation
•
9th Grade
17 questions
Lesson 4.5 Scatter plots
Presentation
•
8th Grade
17 questions
Function or Not
Presentation
•
8th Grade
14 questions
Computer Science History
Presentation
•
8th Grade
18 questions
Nonfiction Review Games 2021
Presentation
•
8th Grade
16 questions
Mars
Presentation
•
KG - 8th Grade
18 questions
Expressions with Square Roots
Presentation
•
8th Grade
Popular Resources on Wayground
10 questions
Safety Day 2026 – Student Review
Quiz
•
9th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
12 questions
Map Skills
Quiz
•
3rd Grade
22 questions
Continents and Oceans
Quiz
•
5th Grade
15 questions
Rounding Decimals
Quiz
•
5th Grade