cd2018's People
cd2018's Issues
git 常用指令
# 初始化專案
$ git init
# 查看狀態
$ git status
# 檢查差異
$ git diff
# 將變更檔案放入暫存區
$ git add index.py
# 使用 commit -m 提交變更
$ git -a -m 'init commit'
# 查看歷史
$ git log
# 放棄已經 commit 的檔案重回暫存區
$ git reset HEAD index.py
# 放棄檔案變更
$ git checkout index.py
cd2018 frist class
練習利用python 將座位表分組
第五組 40523145 練習利用python 將座位表分組
第五組倉儲
參考網站:
#!/usr/bin/python3
"""
with open("2018cd.txt") as fh:
lines = fh.readlines()
#print(len(lines))
print(lines)
"""
'''
try:
f = open('2018cd.txt', 'r')
print(f.read())
finally:
if f:
f.close()
'''
"""
['40523115\t40523108\t40523116\t40523144\t40523111\t40523141\t40523104\t40523102\t40523123\n'
, '40523137\t40523117\t40523135\t40523147\t40523146\t40523145\t40523122\t40523136\t40523132\n'
, '40523127\t40523126\t40523125\t40523124\t40523118\t40523131\t40523121\t40523120\t40523119\n'
, '40523105\t40523106\t40523107\t40523143\t40523128\t40523129\t40523130\t40523139\t40523133\n'
, '40523142\t40523148\t40523140\t40523113\t40523138\t40523134\t\t']
"""
'''
40523115 40523108 40523116 40523144 40523111 40523141 40523104 40523102 40523123
40523137 40523117 40523135 40523147 40523146 40523145 40523122 40523136 40523132
40523127 40523126 40523125 40523124 40523118 40523131 40523121 40523120 40523119
40523105 40523106 40523107 40523143 40523128 40523129 40523130 40523139 40523133
40523142 40523148 40523140 40523113 40523138 40523134
'''
with open("2018cd.txt") as fh:
# 逐行讀出檔案資料, 並放入數列中
lines = fh.readlines()
# 設法用迴圈逐數列內容取出字串
# 組序變數 z 起始值設為 0
z = 0
for i in range(len(lines)):
# 利用 strip() 去除各行字串最末端的跳行符號
#print(lines[i].strip())
line = lines[i].strip()
# 利用 split() 將以 \t 區隔的字串資料分離後納入 groups 字串
groups = line.split("\t")
#print(groups)
for i in range(len(groups)):
# 每組有三名組員
if i%3 == 0:
# 每三位組員組序增量 1
z += 1
#+= 加號
print()
print("第" + str(z) + "組:")
print(groups[i])
else:
print(groups[i])
"""
第1組:
40523115
40523108
40523116
第2組:
40523144
40523111
40523141
第3組:
40523104
40523102
40523123
第4組:
40523137
40523117
40523135
第5組:
40523147
40523146
40523145
第6組:
40523122
40523136
40523132
第7組:
40523127
40523126
40523125
第8組:
40523124
40523118
40523131
第9組:
40523121
40523120
40523119
第10組:
40523105
40523106
40523107
第11組:
40523143
40523128
40523129
第12組:
40523130
40523139
40523133
第13組:
40523142
40523148
40523140
第14組:
40523113
40523138
40523134
"""
python 語法
https://www.gitbook.com/book/chusiang/using-python/details
https://chusiang.gitbooks.io/using-python/ListAndTuple.html
https://blog.kdchang.cc/2017/08/15/learning-programming-and-coding-with-python-list-tuple-dict-set/
https://openhome.cc/Gossip/Python/WithAs.html
"http://lab.kmol.info/blog/brython-programming-environment.html?
How to be a star engineer
gitbook test
Lua Learning
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.