Wilson 練習題: https://yuhsien.notion.site/Python-Practice-30411d016dcc4fafa82559fe6d9259ea
Google colab (可以線上即時共同編輯): *感謝Eric推薦
https://colab.research.google.com/drive/1QHxjPNB98GDIKqCuPsMs3vermoamG0x0?usp=sharing
Simple Exercise I
- 1 Write a function called "printMany" that prints out integers 1, 2, 3, ..., 100.
- 2 Write a function called "printEvery3" that prints out integers 1, 4, 7, 10, ..., 88.
- 3 Write a function called "position" that returns a tuple of the first uppercase letter and its index location. If not found, returns -1.
- 4 Write a function called "findSmallCount" that takes one list of integers and one integer as input, and returns an integer indicating how many elements in the list is smaller than the input integer.
- 5 Write a function called "findSmallerTotal" that takes one list of integers and one integer as input, and returns the sum of all elements in the list that are smaller than the input integer.
- 6 Write a function called "findAllSmall" that takes one list of integers and another integer as input, and returns a list of integers that contains all elements that are smaller than the input integer.
- 7 Write a function called "summ" that takes one list of numbers, and return the sum of all elements in the input list.
Simple Exercise II
- 1 Write a function called "stars" which prints out layers of stars in the following pattern
- 2 Write a function called "stars2" which prints out layers of stars in the following pattern
- 3 Write a function called "table" which takes an input n, and prints out n x 1 to n x 9
- 4 Write a function called "table9to9" that prints out the multiplication table: