發表文章

目前顯示的是 3月, 2024的文章

洪志坤開啟資料夾編寫檔案

圖片
space, slash, backslash, cr = ' ', '/', '\\', '\n' k = 1 f = open("洪志坤.txt",'w',encoding="utf8") for i in range(1, k+1): for j in range(k-i): f.write(space) f.write(slash) for j in range(2*i-2): f.write(space) f.write(backslash) for j in range(k-i): f.write(space) f.write(cr) for i in range(1, k+1): for j in range(i-1): f.write(space) f.write(backslash) for j in range(2*k-2*i): f.write(space) f.write(slash) for j in range(i-1): f.write(space) f.write(cr) f.close() VS code開發環境截圖 程式碼 space, slash, backslash, cr = ' ', '/', '\\', '\n' k = input('輸入規格: ') m = input('輸入橫向規格: ') k, m = int(k), int(m) #將字串k轉integer整數 f = open("陳水扁.txt",'w',encoding="utf8") for i in range(1, k+1): for ii in range(m): for j in range(k-i): f.write(space)...

洪志坤python檔案方法utf8

圖片
utf8 encoding編碼 練習程式碼 f = open("ascii.txt", "r+", encoding='utf8') x = f.read() print(x) f.write("\n洪志坤") #寫入字串 f.close() #洪志坤關閉檔案r+讀增加append print('f長度',len(x)) for i in x: #用迴圈印出每一個字元 print(i) 影片377 影片378 ascii art字元藝術 上面的原始碼,拷貝下面的code在html模式貼上就可以  <iframe src="https://en.wikipedia.org/wiki/ASCII_art" height=400 width=100%></iframe>

洪志坤word一個投機者的告白heading1標題1另存網頁

圖片
一個投機者的告白 內容 第 1 章金錢的魅力 (p.39) . 1 第 2 章證券交易動物園 (p.54) . 2 賭徒永遠不死 (p.54 次標題 ) 2 第 3 章憑什麼投機? (p.72) . 2 第 4 章奇幻的證券交易所 (p.92) . 2 第 5 章指數有什麼道理 (p.104) . 3 中央銀行:利率的獨裁者 (p.125 次標題 ) . 5 是否有錢 (p.137 次標題 ) . 6 憂鬱的 1982 (p. 148 小標題 ) . 8 過熱的 1987(p. 150 小標題 ) . 9 亢奮之下的失序 (p.153 次標題 ) 10 數學毀掉法國 (p.165 次標題 ) 10 勇於與眾不同 (p.181 次標題 ) 12 第 11 章從證券交易所到交易股票 (p.219) . 13 圖表可能賺錢,但肯定賠錢 (p.226 次標題 ) 13 第 12 章用別人的錢交易的投機者 (p.231) . 15 又一個失利案例 (p.236 次標題 ) 15     安德烈.科斯托蘭尼 Andre Kostolany 著,唐峋譯,商業周刊出版 2018 年增訂版 13.5 刷。 以下文字改寫自 http://www.zion.idv.tw/~tony/file/ 一個投機者的告白 %E4%B8%80%E5%80%8B%E6%8A%95%E6%A9%9F%E8%80%85%E7%9A%84%E5%91%8A%E7%99%BD.txt 4E00,500B,6295,6A5F,8005,7684,544A,767D 第 1 章金錢的魅力 (p.39) 自由世界的價值標準 (p.41 次標題 ) 百萬富翁需要多少錢? (p.44 次標題 ) 金錢的兩種極端 (p.45 次標題 ) 我是投機人士,始終如一 (p.49 次標題 )   第 2 章證券交易動物園 (p.54) 賭徒永遠不死 (p.54 次標題 ) 經紀人:只管成交量 (p...

洪志坤python內建built-in函數function迴圈loop範圍range

圖片
vs code與w3schools截圖 for i in range(9,19): print("洪志坤hex十六進",hex(i)) print("bin二進位",bin(9)) print(any([True, False, True])) print(-1 2,3>2,True,-1 w3schools內建函數列表 Function Description abs() Returns the absolute value of a number all() Returns True if all items in an iterable object are true any() Returns True if any item in an iterable object is true ascii() Returns a readable version of an object. Replaces none-ascii characters with escape character bin() 二進位數Returns the binary version of a number bool() Returns the boolean value of the specified object bytearray() Returns an array of bytes bytes() Returns a bytes object callable() Returns True if the specified object is callable, otherwise False chr() Returns a character字元 from the specified Unicode code. classmethod() Converts a method into a class method compile() Returns the specified source as an object, ready to be executed complex() Returns a complex number delattr() Deletes the specified attribute...