from math import * #劉任昌從math輸入所有函式
# import math #劉任昌輸入math函式庫
def abc(r): #定義函數abc
print("圓面積: "+str(pi*r*r))
print("圓周長: "+str(pi*r*2))
print("球體積: "+str(pi*r*r*r*4/3))
print("球表面積:"+str(pi*r*r*4))
def tri(z):
print("正弦sin "+str(sin(z)))
print("餘弦cos "+str(cos(z)))
def group(r, t):
abc(r)
tri(t)
r , t = 1, pi/3 #半徑, 60度=pi/3
group(r,t)
import math
from math import *
心得使用ul=undered list標記語言
- 輸入函式庫,例如比較
- import math
- from math import all
- 自訂函數
- def 函數名稱()
- Define
- Definite當然的
- Definition
- 常常被利用於模組化程式碼
貼到VS Code建立視窗
from math import * #劉任昌從math輸入所有函式
from tkinter import *#從建構視窗函式庫輸入所有函式
# import math #劉任昌輸入math函式庫
def abc(r): #定義函數abc
print("圓面積: "+str(pi*r*r))
print("圓周長: "+str(pi*r*2))
print("球體積: "+str(pi*r*r*r*4/3))
print("球表面積:"+str(pi*r*r*4))
def tri(z):
print("正弦sin "+str(sin(z)))
print("餘弦cos "+str(cos(z)))
def group(r, t):
abc(r)
tri(t)
r , t = 1, pi/3 #半徑, 60度=pi/3
group(r,t)
tk = Tk()
tk.title("劉任昌tkinter視窗")
canvas = Canvas(tk, width=600, height=400)
canvas.pack()
label1 = Label(tk, text="輸入半徑:", font=('微軟粗黑體', 20))
label1.pack()
tk.mainloop()
https://d10917257.blogspot.com/2023/05/pythonimportmathdefinefunction.html
回覆刪除作者已經移除這則留言。
回覆刪除https://d11150113.blogspot.com/2023/05/pythonimportmathdefinefunction.html
回覆刪除https://cpc920508123.blogspot.com/2023/05/pythonimportmathdefinefunction.html
回覆刪除https://jasperyang.blogspot.com/2023/05/blog-post.html
回覆刪除https://hhhaann.blogspot.com/2023/05/pythonimportmathdefinefunction.html
回覆刪除https://enchenghu0905.blogspot.com/2023/05/pythonimportmathdefinefunction.html
回覆刪除作者已經移除這則留言。
回覆刪除https://www.blogger.com/blog/post/edit/preview/4399220548584548192/6071718889808964017
回覆刪除https://d11150108.blogspot.com/2023/05/pythonimportmathdefinefunction.html
回覆刪除https://d11150114.blogspot.com/2023/05/pythonimportmathdefinefunction.html
回覆刪除https://jjjjjyyy.blogspot.com/2023/05/pythonimportmathcdefinefunction.html
回覆刪除https://cindy-javascript.blogspot.com/2023/05/pythonimportmathdefinefunction.html
回覆刪除https://spencer0309.blogspot.com/2023/05/pythonimportmathdefinefunction.html
回覆刪除https://jdoifjopq1264.blogspot.com/2023/05/pythonimportmathdefinefunction.html
回覆刪除https://trequiem.blogspot.com/2023/05/pythonimportmathdefinefunction.html
回覆刪除https://lihtml-css-javascript-java.blogspot.com/2023/05/pythonimportmathdefinefunction.html
回覆刪除https://chenyouzheng0329.blogspot.com/2023/05/pythonimportmathdefinefunction.html
回覆刪除https://iuytjhg5261.blogspot.com/2023/05/pythonimportmathdefinefunction.html
回覆刪除https://d11150115.blogspot.com/2023/05/pythonimportmathdefinefunction.html
回覆刪除https://alien1213.blogspot.com/2023/05/pythonimportmathdefinefunction.html
回覆刪除https://pandora-mo.blogspot.com/2023/05/pythonimportmathdefinefunction.html
回覆刪除https://rtytrdtfg.blogspot.com/2023/05/pythonimportmathdefinefunction.html
回覆刪除https://fongcyf.blogspot.com/2023/05/pythonimportmathdefinefunction.html
回覆刪除