Task 1: Write a Python program to construct an array by repeating the values within the original array three times.
We can repeat a list using the operator *
in python. The following code defines a function to repeat the original list three times:
>>> def triple_list(l):
... return l * 3
...
>>> triple_list([1,2,3,4])
[1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4]
I want to introduce one of my personal project last year, which is similar to task 2. The project is to show the real-time weather in China.
I develop a web crawler to get real-time weather data of each region in China, and then display the result in web map using OpenLayers3. The weather data and geojson data are published using Flask API. Users can browse each place by dragging, clicking, scrolling and searching.
- This project is still running on my server. Please click here to check the "Map of Weather".
- The source code is available on github: https://github.com/Gooong/WeatherMap