發表文章

許家銘python內建built-in函數functions迴圈loop

圖片
截圖 程式碼 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

圖片
單元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...

許家銘程式設計JAVA

圖片

許家銘JAVA繪製選擇權到期日損益圖

圖片

許家銘canvas與svg繪圖套件

圖片
canvas繪圖套件繪製選擇權到期日損益圖 許家銘買入選擇權到期日損益 許家銘賣出選擇權到期日損益 W3SHOOLS繪圖工具示範CANVAS Your browser does not support the HTML canvas tag. W3SHOOLS繪圖工具示範SVG Sorry, your browser does not support inline SVG. Sorry, your browser does not support inline SVG. Note: This example does not work in Firefox. 心得 程式語言編寫,需要編譯器compiler或直譯器interpreter執行。 瀏覽器Chrome或Edge是HTML, CSS, JavaScript的直譯器。 JAVA語言的編譯器是JDK, Java Development Kit爪哇開發工具。 VS Code是撰寫程式的整合開發環境IDE, Integrated Development Environment,可以編寫程式碼,也可以編譯程式,但需要裝Java延伸套件Extension Pack for Java 圖片 365影片

許家銘金融市場158至170數學符號輸入Math

圖片
金融市場常識題庫153至163 mfrac=math fraction分數text文字 ms商業套裝C, 除權息參考價 除權前一天60除權無償配股利的開盤參考價 除權息前一天價值=除權息當天價值 60=3+x⇒x=57 除權前一天60除權2元股票股利的開盤參考價 除權息前一天價值=除權息當天價值 60=(1+ 2 10 )x=1.2x⇒x= 60 1+0.2 =50 除權前一天60除權2元股票股利+3元現金股利的開盤參考價 除權息前一天價值=除權息當天價值 60=3+(1+ 2 10 )x=1.2x⇒x= 60-3 1+0.2 =47.5 練習mroot開平方msqrt 2 7 大約1(1+0.1) 開平方 100.0 =10 信用戶維持率 fraction分數 融資戶維持率= 融資購買股票現在的價值 融資的金額 division軍團區塊 融券維持率= 放空股票的金額+保證金 放空股票的現在價值 整戶維持率=上面分子加分子 / 分母加分母 358影片 以上的程式碼 <STYLE>H1{BACKGROUND-COLOR:DARKGREEN; COLOR:WHITE; PADDING:5PX;TEXT-ALIGN:CENTER} .d{font-size:2em; text-align:center;line-height:1.5;} </STYLE> <H1 class="d">金融市場常識題庫153至163</H1> mfrac=math fraction分數text文字 ms商業套裝C, <h1>除權息參考價</h1> <div class="d"> <h2>除權前一天60除權無償配股利的開盤參考價</h2>  除權息前一天價值=除權息當天價值<br/> <math><mtext>60=3+x&rArr;x=5...

許家銘JavaScript物件CANVAS繪製選擇權到期日損益

圖片
拷貝甲班示範 identifier名稱,身分證id card w3schools學物件 男人嘴w3schools練習截圖 wikipedia括號brackets 常見的括弧有: 圓括弧 (英語: parentheses 或英語: round brackets ),中文中又稱 小括弧 、 括弧 。 半形  : ( ) 全形  : ( ) 方括弧 (英語: brackets 或英語: square brackets ),中文中又稱 中括弧 。 半形 : [ ] 全形: [ ] 花括弧 (英語: braces ,或英語: curly brackets ), 中文中又稱 大括弧 。 半形: { } 全形: { } 角括弧 (英語: chevrons 或英語: angle brackets ),中文中又稱為 尖括弧 。 半形 : ⟨ ⟩ ,在英文中指示想到而未說的話語,但經常由 小於號 ( < )和 大於號 ( > )代替 。 全形 : 〈 〉 ,在中文中用作 單書名號 雙角括弧(英語: double angle brackets ),中文中又稱為 雙尖括弧 。 半形: ⟪ ⟫ 全形: 《 》 ,在中文中用作 雙書名號 心得 delete 物件的.屬性; 增加物件band["singer"]=.... 以上繪圖原始碼 <h1>canvas繪圖套件繪製選擇權到期日損益圖</h1> <canvas id="BuyOptions" width="500" height="300"></canvas> <script> const c = document.getElementById("BuyOptions"); const ctx = c.getContext("2d"); ctx.beginPath(); ctx.moveTo(0, 0); ctx.lineTo(100, 100); ctx.lineTo(200,100); ctx.font = "16px Arial"; ctx.fillText("買入賣權puts的到...