Professional Documents
Culture Documents
2020 Aiep HS S10 SC
2020 Aiep HS S10 SC
2020 Aiep HS S10 SC
Website: amsliphil.com
Email address: amsliphil@yahoo.com
Student Copy
High School Session 10
names = ["Isaac Newton", "Albert Einstein", "Niels Bohr", "Marie Curie", "Charles Darwin", "Louis Pasteur", "Galileo
Galilei", "Margaret Mead"]
Exercise 2. Goal: Write down the cubes of the first 10 natural numbers
Produce: [0, 1, 8, 27, 64, 125, 216, 343, 512, 729]
Using: a) loop, b) list comprehension
Exercise 3. Goal: Given an input list nums, produce a list of the even numbers in nums
nums = [3, 1, 4, 1, 5, 9, 2, 6, 5]
Exercise 4. Goal: Return all ordered pairs of 2 die-rolls that give a sum greater than or equal to eight.
Result list should be a list of 2-tuples: [(2, 6), (3, 5), (3, 6), (4, 4), (4, 5), (4, 6), (5, 3), (5, 4), (5, 5), (5, 6), (6, 2), (6, 3),
(6, 4), (6, 5), (6, 6)]
Exercise 7. Given two lists. Iterate both lists simultaneously such that list1 should display item in original order and
list2 in reverse order.
Kim wants to know what score she needs to get in her 4th exam to get a specific score given her previous 3 test
scores
then print
1. the grade that she needs to get in her 4th exam
2. convert her needed grade (the one you just computed) into letter grade
Example:
Input: 5@L5a
Output: Salsa
we want to build a game scorer which stores the scores in a list and at the end tells us who won
Assuming 3 games
Example:
the first string is the string that we will be looking for in the second string
Output:
Yehey
Input:
ik
kimberly
Output:
Aww
make a program that takes a binary number as input and converts it to decimal
Sample:
Input:
101011
Output:
43
a made-up language formed from English by transferring the first letter of each word to the end of the word and
adding a vocalic syllable (-ay) so chicken soup would be translated to hickencay oupsay . Pig Latin is typically spoken
playfully, as if to convey secrecy.
Input:
hello there
Output:
ellohay heretay
Output:
[[2, 3, 5, 8, 9], [12, 14, 23, 21, 67], [32, 35, 61, 17, 25], [54, 36, 87, 10, 21], [11, 4, 2, 5, 8]]