Posts

王恩琪python檔案方法utf8

Image
f = open("ascii.txt", "r",encoding='utf8') print(f.read()) f.close() x = "王恩琪" f = open("ascii.txt", "r+",encoding='utf8') y = f.write(x) print(y) f.close() print(i) f = open("ascii.txt", "r+",encoding='utf8') #a代表附加append print("名稱",f.name) print("模式",f.mode) print("關閉",f.closed) f.write('王恩琪') line = f.read() #讀取檔案f成為字串 print('檔案字串長度',len(line)) print("檔案內容",line) f.close() 影片379 影片380

王恩琪python內建built-in函數functions迴圈loop

Image
截圖 程式碼 print(int(10)) print(int("ff",16)) print(int('100',16)) print(int('100',8)) a = [0>1, 2>1, 3==3]#串列list使用square bracket中括號 print("是否all全真",all(a)) print("存在任何any一個真",any(a)) print("王恩琪bin二進位輸出一到9") for i in range(10): #0 to 9進位1 print(bin(i)) for i in range(0, 200, 10): print(hex(i)) a = ('蘋果', '香蕉', '櫻桃',"durian") b = "Hello World" c = 33 d ={'蘋果', '香蕉', '櫻桃',"durian"} e=['蘋果', '香蕉', '櫻桃',"durian"] print("a元組typle", type(a)) print("b字串", type(b)) print("c整數integer", type(c)) print(type(d), type(e)) w3schools內建函數列表 Python has a set of built-in functions. 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 readab...

王恩琪Python字串string方法methods

Image
單元371影片 vs code與w3schools截圖 程式碼 txt = "王恩琪Love西瓜,西瓜我my favoritE水果西瓜" print(txt.count("西瓜")) print('先練習內建函數len',len(txt)) print('find',txt.find("西瓜")) print('rfind',txt.rfind("西瓜")) print("print列印,字串string字元character的組合") print(txt.title()) print(txt.lower()) print(txt.upper()) print(txt.swapcase()) print(txt.zfill(32)) print(txt.startswith("王")) print(len(txt)) for i in range(33333, 33344): print(chr(i)) for i in range(65, 70): print(chr(i)) w3schools字串方法列表 Method Description capitalize() Converts the first character to upper case casefold() Converts string into lower case center() Returns a centered string count() Returns the number of times a specified value occurs in a string encode() Returns an encoded version of the string endswith() Returns true if the string ends with the specified value expandtabs() Sets the tab size of the string find() Searches the string for a specified value a...

王恩琪繪製選擇權到期日損益圖

Image
心得 程式語言編寫,需要編譯器compiler或直譯器interpreter執行。 瀏覽器Chrome或Edge是HTML, CSS, JavaScript的直譯器。 JAVA語言的編譯器是JDK, Java Development Kit爪哇開發工具。 VS Code是撰寫程式的整合開發環境IDE, Integrated Development Environment,可以編寫程式碼,也可以編譯程式,但需要裝Java延伸套件Extension Pack for Java

王恩琪canvas與svg繪圖套件

canvas繪圖套件繪製選擇權到期日損益圖 王恩琪買入選擇權到期日損益 王恩琪賣出選擇權到期日損益 w3schools練習canvas Your browser does not support the HTML canvas tag. w3schools練習svg Note: strong-強調 複製自"https://www.w3schools.com/graphics/tryit.asp?filename=trysvg_ellipses"

王恩琪金融市場158至170數學符號輸入-math

除權前一天60除權2元股票股利+3元現金股利的開盤參考價 除權息前一天價值=除權息當天價值 60=3+(1+ 2 10 )x=1.2x⇒x= 60-3 1+0.2 =47.5 除權前一天60除權2元股票股利+3元現金股利的開盤參考價 除權息前一天價值=除權息當天價值 60=3+x⇒x=57 除權前一天60除權2元的開盤參考價 除權息前一天價值=除權息當天價值 60=(1+ 2 10 )x=1.2x⇒x= 60 1+0.2 =50

王恩琪JavaScript物件Canvas繪製選擇權到期日損益

Image
借用甲班程式碼 identifier名稱,身分證id card w3school學物件 維基百科-括弧 常見的括弧有: 圓括弧 (英語: parentheses 或英語: round brackets ),中文中又稱 小括弧 、 括弧 。 半形  : ( ) 全形  : ( ) 方括弧 (英語: brackets 或英語: square brackets ),中文中又稱 中括弧 。 半形 : [ ] 全形: [ ] 花括弧 (英語: braces ,或英語: curly brackets ), 中文中又稱 大括弧 。 半形: { } 全形: { } 角括弧 (英語: chevrons 或英語: angle brackets ),中文中又稱為 尖括弧 。 半形 : ⟨ ⟩ ,在英文中指示想到而未說的話語,但經常由 小於號 ( < )和 大於號 ( > )代替 。 全形 : 〈 〉 ,在中文中用作 單書名號 雙角括弧(英語: double angle brackets ),中文中又稱為 雙尖括弧 。 半形: ⟪ ⟫ 全形: 《 》 ,在中文中用作 雙書名號 心得 delete-物件屬性 band-增加物件 band["singer"] canvas繪製選擇權到期日權益圖