Friday, April 24, 2020

Python (or other programming language) Home work for kids

Python (or other programming language) Home work:
Unit 1:
1. Write/Print "I'm Paul, I'm learning Python" 10000 times
with blank line, all upper case ...
2. Print all numbers between 1 to 2000
print even numbers only, print even numbers which can divide 3
3. Calculate the sum the event numbers from 1 to 1000
4. How many numbers contain 4 in any digits for the number between 1 to 1000 (good, hard to search)

Unit 2:
1. Same with Day 1 but with functions
2. Calculate Fibonacci
3. Put "Rock Paper Scissors" randomly for 10000 times, are they really random? (good)
4. Print the unrecognized Chinese characters in random order
5. Put the unrecognized Chinese characters in a file, and read the file, print the characters in random order to help review

Unit 3:
1. Make a function to convert fahrenheit to celsius, and vice versa
2. Make a function to calculate min/max/avg/mid for a number array
3. Make a function to convert kilometers to miles, and vice versa
4. Make a function to convert liter to galon, and vice versa
5. Make a function to convert meter to centimeter, and vice versa
6. How to make it a module and call later

Unit 4:
The Three Little Pigs
1. Read a text book file, and tell me how many words in this book, which word appears most?
2. Read a text book file, and tell me how many letters in this book, which letter appears most?
3. Read a text book file, and tell me which line is longest line?
4. Read a text book file, and add line length to every line's beginning.

Unit 5:
How to make unit 4 smarter (AI), the input could be
convert 12 km to miles, or convert 3 liter to galon or 300 centimeter to meter

Unit 6:
1. greatest common factor
2. least common multiple

Unit 7:
Frog jumping
How many Friday and 13 during the latest 1000 years?

Unit 8 (File read/write):
Read stock daily data file, add name to every line
Read stock daily data file, calculate percentage, ma5, ma10 and write back to the file

Unit 9 (network and library):
Retrieve all League of Legends champions skins picture and write them into local hard disk, the folder name is organized by the champion name

Unit 10 (database):
1. Save the daily data file of Unit 8 to MongoDB
2. Save all League of Legends skins of Unit 9 to MongoDB

No comments:

Post a Comment