Album
米Teen唔鐘意玩現成品,喜歡由零件開始砌。99次失敗唔係問題,最緊要係有1次成功!
米Teen總部設在聖公會白約翰會督中學506室,在午膳後和放學後集會。有興趣參與的同學,請與會長或導師聯絡。
2025-12-06 19:30:14
溫度23℃ 濕度88% 氣壓1018.66hPa
2025-12-06 14:18:10
閃電17km (1)
2025-12-05 16:28:24
閃電20km (0)
2025-12-05 13:03:50
閃電17km (1)
2025-12-05 13:03:36
閃電20km (0)
2025-12-04 17:22:28
閃電17km (1)
2025-12-03 08:39:50
閃電1km (12)
2025-12-03 08:39:48
閃電1km (1)
2025-12-03 08:39:45
閃電1km (1)
2025-12-03 08:39:38
閃電1km (0)
2025-12-03 08:39:35
閃電1km (16)
溫度23℃ 濕度88% 氣壓1018.66hPa
2025-12-06 14:18:10
閃電17km (1)
2025-12-05 16:28:24
閃電20km (0)
2025-12-05 13:03:50
閃電17km (1)
2025-12-05 13:03:36
閃電20km (0)
2025-12-04 17:22:28
閃電17km (1)
2025-12-03 08:39:50
閃電1km (12)
2025-12-03 08:39:48
閃電1km (1)
2025-12-03 08:39:45
閃電1km (1)
2025-12-03 08:39:38
閃電1km (0)
2025-12-03 08:39:35
閃電1km (16)
Find the longest increasing subsequence.
>>>Find the l...
Find the longest increasing subsequence in a data file.
| 1 | # Author: HUANG KWUN HOI (SKHBBSS, class 4D) |
| 2 | # Last modified: 2020.9.8 |
| 3 | file1=open('data2.txt', 'r') |
| 4 | list1=[] |
| 5 | list2=[] |
| 6 | longest_series=[] |
| 7 | x=0 |
| 8 | current_datum=0 |
| 9 | next_datum=0 |
| 10 | previous_longest_series_length=0 |
| 11 | current_series_length=0 |
| 12 | for data in file1: |
| 13 | a=data |
| 14 | b=a.split(',') |
| 15 | next_datum=float(b[1]) |
| 16 | list1.append(current_datum) |
| 17 | if x==0: |
| 18 | del list1[0] |
| 19 | x=1 |
| 20 | if current_datum>=next_datum: |
| 21 | previous_longest_series_length=int(len(longest_series)) |
| 22 | current_series_length=int(len(list1)) |
| 23 | if current_series_length>previous_longest_series_length: |
| 24 | longest_series=list1.copy() |
| 25 | list2=list1.copy() |
| 26 | list1.clear() |
| 27 | else: |
| 28 | list2=list1.copy() |
| 29 | second_last_datum=current_datum |
| 30 | current_datum=next_datum |
| 31 | file1.close() |
| 32 | if current_datum>second_last_datum: |
| 33 | list2.append(current_datum) |
| 34 | current_series_length=int(len(list2)) |
| 35 | if current_series_length>previous_longest_series_length: |
| 36 | longest_series=list2.copy() |
| 37 | print(longest_series, ' (', int(len(longest_series)), 'Days)' ) |
Album
米Teen唔鐘意玩現成品,喜歡由零件開始砌。99次失敗唔係問題,最緊要係有1次成功!
米Teen總部設在聖公會白約翰會督中學506室,在午膳後和放學後集會。有興趣參與的同學,請與會長或導師聯絡。
2025-12-06 19:30:14
溫度23℃ 濕度88% 氣壓1018.66hPa
2025-12-06 14:18:10
閃電17km (1)
2025-12-05 16:28:24
閃電20km (0)
2025-12-05 13:03:50
閃電17km (1)
2025-12-05 13:03:36
閃電20km (0)
2025-12-04 17:22:28
閃電17km (1)
2025-12-03 08:39:50
閃電1km (12)
2025-12-03 08:39:48
閃電1km (1)
2025-12-03 08:39:45
閃電1km (1)
2025-12-03 08:39:38
閃電1km (0)
2025-12-03 08:39:35
閃電1km (16)
溫度23℃ 濕度88% 氣壓1018.66hPa
2025-12-06 14:18:10
閃電17km (1)
2025-12-05 16:28:24
閃電20km (0)
2025-12-05 13:03:50
閃電17km (1)
2025-12-05 13:03:36
閃電20km (0)
2025-12-04 17:22:28
閃電17km (1)
2025-12-03 08:39:50
閃電1km (12)
2025-12-03 08:39:48
閃電1km (1)
2025-12-03 08:39:45
閃電1km (1)
2025-12-03 08:39:38
閃電1km (0)
2025-12-03 08:39:35
閃電1km (16)

絕不能在一粒細小的電阻上印上數字來表表它的阻值,只能用色條來表示。記熟了這些色碼(Resistor Color Code),就能隨時讀出一粒電阻的阻值了。
晶體管(Transistor)有很多用途,只要了解幾款晶體管的特性,已能解決大部份驅動電路(Driver circuit)的問題了。
Arduino,電子線路,網站設計等等。