發表文章

謝孜妤python寫入write迴圈範圍range

圖片
space, slash, backslash, cr = ' ', '/', '\\', '\n' k = input('輸入規格: ') m = input('輸入橫向規格: ') k,m =int(k),int(m)#將字串k轉integer整數 f = open("謝孜妤.txt",'w',encoding="utf8") f.write('謝孜妤讀取檔案'+cr)#註解/n換列 for i in range(1, k+1): for ii in range(m): 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() for i in range(1,100,10):#開始1到99進位10 print(i,end=')#預設是end='/n'

謝孜妤檔案方法

圖片
f = open("ascii.txt", "r+", encoding='utf8') x = f.read() print(x) f.write("\謝孜妤") #寫入字串 f.close() #謝孜妤關閉檔案r+讀增加append print('f長度',len(x)) for i in x: #用迴圈印出每一個字元 print(i)

謝孜妤python內建built-in函數function迴圈loop範圍range

curly bracket 集合 square bracket 串列 round bracket 元組 parenthesessis 文章中的 type型態style樣式 bin(a)轉成2進位 hex(a)將a轉16進位 int(a,b)將b進位的a轉10 print(3 1,2>1,3==3]#串列list使用square bracket中括號 print("是否all全真",all(a)) print("存在任何any一個真",any(a)) print("謝孜妤bin二進位輸出1到9") for i in range(10): print(bin(i)): mylist = [True, True, True] x = all(mylist) print(x) w3school內建函數列表 a 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...

謝孜妤Python字串string 方法mathods

圖片
單元371影片 vs code與w3school截圖 程式碼 txt = "謝孜妤 love 蘋果, 蘋果 are my favorite fruit" print( txt.count("蘋果")) print( txt.find("蘋果")) print('先練習內建函數len',len(txt)) print( txt.rfind("蘋果")) txt = "50" print(txt.zfill(10)) txt = "Hello my friends" print(txt.upper()) txt = "Hello My Name Is PETER" print(txt.swapcase()) txt = "Hello my FRIENDS" print( txt.lower()) for i in range(33333,33344): print(chr(i)) for i in range(65,100): print(chr(i)) 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 and returns the position of ...

謝孜妤java程式設計

圖片
import java.awt.*; import java.awt.geom.Line2D; import javax.swing.*; public class Options { public static void main(String[] args) { JFrame frame = new JFrame("謝孜妤Java繪製選擇權到期日損益"); Container cp = frame.getContentPane(); cp.add(new JComponent() { public void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D) g; g2.setStroke(new BasicStroke(2));//stroke中風,筆觸 g2.setFont(new Font("monospaced", Font.BOLD|Font.ITALIC , 30)); g2.setColor(Color.black); g2.drawString("買入賣權到期日損益",0,120); g2.draw(new Line2D.Float(0, 0, 100, 100)); g2.draw(new Line2D.Float(100, 100, 200, 100)); g2.drawString("買入買權到期日損益",300,120); g2.draw(new Line2D.Float(300, 100, 400, 100)); g2.draw(new Line2D.Float(400, 100, 500, 0)); g2.drawString("賣出賣權到期日損益...

謝孜妤w3schools繪圖canvas與svg

圖片
canvas繪圖套件繪製選擇權到期日損益圖 買入選擇權到期日損益 賣出選擇權到期日損益 w3schools學習canvas繪圖 Your browser does not support the HTML canvas tag. w3schools學習svg繪圖 Note: This example does not work in Firefox. 爪哇期末考 vscode安裝編輯java的延伸套件extension pack for java

謝孜妤金融市場常識測驗158至170相關數學表示

圖片
金融市場常識題庫153至163 mfr ac=math fraction分數text文字 金融市場常識題庫164至170 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元現金股利的開盤參考價 除權息前一天價值=除權息當天價值 math mtext數學text文字frac=fraction分數分裂 60=3+(1+ 2 10 )x=1.2x⇒x= 60-3 1+0.2 =47.5 練習mroot開平方msqrt 7 2 大約1(1+0.1) 開平方 100.0 =10 信用戶維持率 fraction分數 融資戶維持率= 融資購買股票現在的價值 融資的金額 準備四萬購買10萬元的股票,準備90萬元保證金,放空100萬股票,股票還沒漲跌,維持率 division軍團區塊 整戶維持率= 融資買進股票現金價值+放空股票的金額+保證金 融資金額+放空股票的現在價值 整戶維持率=上面分子加分子 / 分母加分母 劉任昌358影片