
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
Answer
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
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
Declaration of Independence
Presentation
•
8th Grade
17 questions
Subject & Predicates
Presentation
•
8th Grade
17 questions
Pythagorean Theorem and Applications
Presentation
•
8th Grade
17 questions
Plot Elements
Presentation
•
8th Grade
17 questions
Infinitives
Presentation
•
8th Grade
17 questions
Population Ecology
Presentation
•
8th Grade
17 questions
Lesson 17: Energy Transformations
Presentation
•
8th Grade
17 questions
Light and sound
Presentation
•
8th Grade
Popular Resources on Wayground
20 questions
"What is the question asking??" Grades 3-5
Quiz
•
1st - 5th Grade
20 questions
“What is the question asking??” Grades 6-8
Quiz
•
6th - 8th Grade
10 questions
Fire Safety Quiz
Quiz
•
12th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
34 questions
STAAR Review 6th - 8th grade Reading Part 1
Quiz
•
6th - 8th Grade
20 questions
“What is the question asking??” English I-II
Quiz
•
9th - 12th Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
47 questions
8th Grade Reading STAAR Ultimate Review!
Quiz
•
8th Grade
Discover more resources for Computers
20 questions
“What is the question asking??” Grades 6-8
Quiz
•
6th - 8th Grade
34 questions
STAAR Review 6th - 8th grade Reading Part 1
Quiz
•
6th - 8th Grade
47 questions
8th Grade Reading STAAR Ultimate Review!
Quiz
•
8th Grade
44 questions
8th Grade Social Studies - Staar Review 2021
Quiz
•
8th Grade
20 questions
8th Grade Science STAAR Review
Quiz
•
8th Grade
8 questions
Amoeba Sister Asexual vs Sexual Reproduction
Interactive video
•
8th Grade
15 questions
Pythagorean Theorem Word Problems Quizizz
Quiz
•
8th Grade
29 questions
8th Grade Social Studies STAAR Review Part 2
Quiz
•
8th Grade