欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Python實(shí)現(xiàn)雙人五子棋對(duì)局

 更新時(shí)間:2022年05月02日 11:33:09   作者:戰(zhàn) 勝  
這篇文章主要為大家詳細(xì)介紹了Python實(shí)現(xiàn)雙人五子棋對(duì)局,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了Python實(shí)現(xiàn)雙人五子棋對(duì)局的具體代碼,供大家參考,具體內(nèi)容如下

效果:

自己需要兩個(gè)棋子:

服務(wù)器玩家全部代碼:

# 案列使用TCP連接
# 這是服務(wù)器端

import socket
import wx
import threading
import time
from PIL import Image

# ?定義套接字 s
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
Cell=40

# 定義窗口類
class MyFrame(wx.Frame):
? ? # 初始化這里就是生成界面,然后綁定了按鈕事件,其他沒了
? ? def __init__(self):
? ? ? ? super().__init__(parent=None,size=(600,600),title="五子棋:服務(wù)器")
? ? ? ? self.Center()
? ? ? ? self.panel=wx.Panel(parent=self)
? ? ? ? #openButton = wx.Button(parent=map, id=1, label="開房間")
? ? ? ? #self.Bind(wx.EVT_BUTTON, self.StartGame)
? ? ? ? self.panel.Bind(wx.EVT_PAINT, self.PaintBackground) # 繪圖
? ? ? ? self.panel.Bind(wx.EVT_LEFT_DOWN,self.GoChess) # 綁定鼠標(biāo)左鍵消息
? ? ? ? self.picture = [wx.Bitmap("黑.png"), wx.Bitmap("白.png")]
? ? ? ? # 創(chuàng)造二維數(shù)組用來判斷自己是否獲勝
? ? ? ? self.map = [[" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "] for y in range(15)]
? ? ? ? # 定義一個(gè)變量來標(biāo)志自己是否可以走棋
? ? ? ? self.IsGoGame = True

? ? ? ? self.StartGame()


? ? # 畫背景函數(shù)
? ? def PaintBackground(self,event):
? ? ? ? self.dc = wx.PaintDC(self.panel)
? ? ? ? # 創(chuàng)造背景
? ? ? ? brush = wx.Brush("white")
? ? ? ? self.dc.SetBackground(brush)
? ? ? ? self.dc.Clear()
? ? ? ? # 畫方格線
? ? ? ? pen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.SOLID)
? ? ? ? self.dc.SetPen(pen)
? ? ? ? for i in range(15):
? ? ? ? ? ? self.dc.DrawLine(0, Cell*i, 600, Cell*i)
? ? ? ? ? ? self.dc.DrawLine(Cell * i, 0, Cell * i, 600)


? ? # 在x,y坐標(biāo)繪制棋子
? ? def PaintPiece(self,x,y):
? ? ? ? image = wx.StaticBitmap(self.panel, -1, self.picture[0],size=(40,40),pos=(x*Cell+Cell/2,y*Cell+Cell/2))
? ? ? ? #image.SetPosition((x*Cell+Cell/2,y*Cell+Cell/2))

? ? # 玩家自己走棋
? ? def GoChess(self,event):
? ? ? ? #SetPosition(event.GetPosition())
? ? ? ? if self.IsGoGame:
? ? ? ? ? ? pos = event.GetPosition() ?# 在x,y坐標(biāo)繪制棋子
? ? ? ? ? ? x = int((pos.x - Cell / 2) // Cell)
? ? ? ? ? ? y = int((pos.y - Cell / 2) // Cell)
? ? ? ? ? ? self.PaintPiece(x, y)

? ? ? ? ? ? # 下子后,向客戶端發(fā)送位置
? ? ? ? ? ? msg = str(x) + "," + str(y)
? ? ? ? ? ? self.conn.send(msg.encode()) ?# 給客戶端發(fā)送信息
? ? ? ? ? ? print("服務(wù)器發(fā)送:", msg)
? ? ? ? ? ? self.map[x][y]="a"
? ? ? ? ? ? # 判斷是否勝利
? ? ? ? ? ? if self.win_lose("a"):
? ? ? ? ? ? ? ? self.one_Dialog("win")
? ? ? ? ? ? self.IsGoGame=False
? ? ? ? else:
? ? ? ? ? ? self.one_Dialog("notGo")

? ? # 開啟服務(wù)器端函數(shù)
? ? def StartGame(self):
? ? ? ? self.otherNum=0
? ? ? ? self.image=[]
? ? ? ? for item in range(50):
? ? ? ? ? ? self.image.append(wx.StaticBitmap(self.panel, -1, self.picture[1], size=(40, 40),pos=(-100,-100)))
? ? ? ? threadGame=threading.Thread(target=self.thread_body,name="Srever")
? ? ? ? threadGame.start()

? ? def thread_body(self):
? ? ? ? s.bind(("127.0.0.1", 8888)) ?# 綁定IP和端口(參數(shù)為二元組),就是尋址
? ? ? ? s.listen(5) ?# 因?yàn)槭荰CP,所有要監(jiān)聽端口
? ? ? ? print("服務(wù)器啟動(dòng)·····")
? ? ? ? self.conn, self.addess = s.accept() ?# 等待客戶端連接(參數(shù)為最大連接數(shù)),返回一個(gè)二元組(新的socket對(duì)象+客戶端地址)
? ? ? ? while True:
? ? ? ? ? ? data = self.conn.recv(1024) ?# 接受1024字節(jié)序列數(shù)據(jù)(這個(gè)函數(shù)阻塞,直到接受到數(shù)據(jù))
? ? ? ? ? ? if len(data) != 0:
? ? ? ? ? ? ? ? msg = data.decode()
? ? ? ? ? ? ? ? print("服務(wù)器接收:",msg)
? ? ? ? ? ? ? ? msg = msg.split(",")
? ? ? ? ? ? ? ? #self.PaintPiece(int(msg[0]), int(msg[1]))
? ? ? ? ? ? ? ? #image = wx.StaticBitmap(self.panel, -1, self.picture[0], size=(40, 40))

? ? ? ? ? ? ? ? # 設(shè)置原來實(shí)例化好的棋子的位置
? ? ? ? ? ? ? ? self.image[self.otherNum].SetPosition((int(msg[0]) * Cell + Cell / 2, int(msg[1])* Cell + Cell / 2))
? ? ? ? ? ? ? ? self.otherNum+=1
? ? ? ? ? ? ? ? self.map[int(msg[0])][int(msg[1])] = "b"
? ? ? ? ? ? ? ? if self.win_lose("b"): # 判斷對(duì)方玩家是否勝利
? ? ? ? ? ? ? ? ? ? self.one_Dialog("lose")
? ? ? ? ? ? ? ? self.IsGoGame = True # 接收消息后 玩家能夠走棋

? ? ? ? ? ? #time.sleep(2)

? ? def one_Dialog(self,msg):
? ? ? ? if msg=="win":
? ? ? ? ? ? dlg = wx.MessageDialog(None, u"你勝利了!", u"恭喜", wx.YES_NO | wx.ICON_QUESTION)
? ? ? ? ? ? if dlg.ShowModal() == wx.ID_YES:
? ? ? ? ? ? ? ? self.Close(True)
? ? ? ? ? ? dlg.Destroy()
? ? ? ? elif msg=="lose":
? ? ? ? ? ? dlg = wx.MessageDialog(None, u"你輸了!", u"很遺憾", wx.YES_NO | wx.ICON_QUESTION)
? ? ? ? ? ? if dlg.ShowModal() == wx.ID_YES:
? ? ? ? ? ? ? ? self.Close(True)
? ? ? ? ? ? dlg.Destroy()
? ? ? ? elif msg == "notGo":
? ? ? ? ? ? dlg = wx.MessageDialog(None, u"等待對(duì)方下棋!", u"提示", wx.YES_NO | wx.ICON_QUESTION)
? ? ? ? ? ? if dlg.ShowModal() == wx.ID_YES:
? ? ? ? ? ? ? ? #self.Close(True)
? ? ? ? ? ? ? ? dlg.Destroy()

? ? def win_lose(self,msg):
? ? ? ? a = str(msg)
? ? ? ? print("a=", a)
? ? ? ? for i in range(0, 11):
? ? ? ? ? ? for j in range(0, 11):
? ? ? ? ? ? ? ? if self.map[i][j] == a and self.map[i + 1][j + 1] == a and self.map[i + 2][j + 2] == a and \
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? self.map[i + 3][
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? j + 3] == a and self.map[i + 4][j + 4] == a:
? ? ? ? ? ? ? ? ? ? print("x=y軸上形成五子連珠")
? ? ? ? ? ? ? ? ? ? return True
? ? ? ? for i in range(4, 15):
? ? ? ? ? ? for j in range(0, 11):
? ? ? ? ? ? ? ? if self.map[i][j] == a and self.map[i - 1][j + 1] == a and self.map[i - 2][j + 2] == a and \
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? self.map[i - 3][
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? j + 3] == a and self.map[i - 4][j + 4] == a:
? ? ? ? ? ? ? ? ? ? print("x=-y軸上形成五子連珠")
? ? ? ? ? ? ? ? ? ? return True
? ? ? ? for i in range(0, 15):
? ? ? ? ? ? for j in range(4, 15):
? ? ? ? ? ? ? ? if self.map[i][j] == a and self.map[i][j - 1] == a and self.map[i][j - 2] == a and self.map[i][
? ? ? ? ? ? ? ? ? ? ? ? ? ? j - 2] == a and self.map[i][
? ? ? ? ? ? ? ? ? ? ? ? ? ? j - 4] == a:
? ? ? ? ? ? ? ? ? ? print("Y軸上形成了五子連珠")
? ? ? ? ? ? ? ? ? ? return True
? ? ? ? for i in range(0, 11):
? ? ? ? ? ? for j in range(0, 15):
? ? ? ? ? ? ? ? if self.map[i][j] == a and self.map[i + 1][j] == a and self.map[i + 2][j] == a and \
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? self.map[i + 3][j] == a and \
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? self.map[i + 4][j] == a:
? ? ? ? ? ? ? ? ? ? print("X軸形成五子連珠")
? ? ? ? ? ? ? ? ? ? return True
? ? ? ? return False


# 應(yīng)用程序
class App(wx.App):
? ? def OnInit(self):
? ? ? ? frame=MyFrame()
? ? ? ? frame.Show()
? ? ? ? return True
? ? def OnExit(self):
? ? ? ? s.close() # 關(guān)閉socket對(duì)象
? ? ? ? return 0

# 進(jìn)入main函數(shù)運(yùn)行:循環(huán)
if __name__=="__main__":
? ? app=App()
? ? app.MainLoop()

客戶端玩家全部代碼:

# 案列使用TCP連接
# 這是服務(wù)器端

import socket
import wx
import threading
import time
from PIL import Image


# ?定義套接字 s
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
Cell=40

# 定義窗口類
class MyFrame(wx.Frame):
? ? # 初始化這里就是生成界面,然后綁定了按鈕事件,其他沒了
? ? def __init__(self):
? ? ? ? super().__init__(parent=None,size=(600,600),title="五子棋:客戶端")
? ? ? ? self.Center()
? ? ? ? self.panel=wx.Panel(parent=self)
? ? ? ? #openButton = wx.Button(parent=map, id=1, label="開房間")
? ? ? ? #self.Bind(wx.EVT_BUTTON, self.StartGame)
? ? ? ? self.panel.Bind(wx.EVT_PAINT, self.PaintBackground) # 繪圖
? ? ? ? self.panel.Bind(wx.EVT_LEFT_DOWN,self.GoChess) # 綁定鼠標(biāo)左鍵消息
? ? ? ? self.picture=[wx.Bitmap("白.png"),wx.Bitmap("黑.png")]

? ? ? ? # 創(chuàng)造二維數(shù)組用來判斷自己是否獲勝
? ? ? ? self.map = [[" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "] for y in range(15)]
? ? ? ? # 定義一個(gè)變量來標(biāo)志自己是否可以走棋
? ? ? ? self.IsGoGame=False

? ? ? ? self.StartGame()

? ? # 畫背景函數(shù)
? ? def PaintBackground(self,event):
? ? ? ? self.dc = wx.PaintDC(self.panel)
? ? ? ? # 創(chuàng)造背景
? ? ? ? brush = wx.Brush("white")
? ? ? ? self.dc.SetBackground(brush)
? ? ? ? self.dc.Clear()
? ? ? ? # 畫方格線
? ? ? ? pen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.SOLID)
? ? ? ? self.dc.SetPen(pen)
? ? ? ? for i in range(15):
? ? ? ? ? ? self.dc.DrawLine(0, Cell*i, 600, Cell*i)
? ? ? ? ? ? self.dc.DrawLine(Cell * i, 0, Cell * i, 600)

? ? # 在x,y坐標(biāo)繪制棋子
? ? def PaintPiece(self,x,y):
? ? ? ? image = wx.StaticBitmap(self.panel, -1,self.picture[0] ,size=(40,40),pos=(x*Cell+Cell/2,y*Cell+Cell/2))
? ? ? ? #image.SetPosition()

? ? def GoChess(self,event):
? ? ? ? #SetPosition(event.GetPosition())
? ? ? ? if self.IsGoGame: # 輪到自己下棋
? ? ? ? ? ? pos = event.GetPosition() ?# 在x,y坐標(biāo)繪制棋子
? ? ? ? ? ? x=int((pos.x-Cell/2)//Cell)
? ? ? ? ? ? y=int((pos.y-Cell/2)//Cell)
? ? ? ? ? ? self.PaintPiece(x, y)

? ? ? ? ? ? # 下子后,向客戶端發(fā)送位置
? ? ? ? ? ? msg=str(x)+","+str(y)
? ? ? ? ? ? s.send(msg.encode()) ?# 給客戶端發(fā)送信息
? ? ? ? ? ? print("客戶端發(fā)送:", msg)
? ? ? ? ? ? self.map[x][y] = "a"
? ? ? ? ? ? # 判斷是否勝利
? ? ? ? ? ? if self.win_lose("a"):
? ? ? ? ? ? ? ? self.one_Dialog("win")
? ? ? ? ? ? self.IsGoGame=False
? ? ? ? else:
? ? ? ? ? ? self.one_Dialog("notGo")


? ? # 開啟服務(wù)器端函數(shù)
? ? def StartGame(self):
? ? ? ? self.image=[]
? ? ? ? self.otherNum = 0
? ? ? ? for item in range(50):
? ? ? ? ? ? self.image.append(wx.StaticBitmap(self.panel, -1, self.picture[1], size=(40, 40), pos=(-100, -100)))
? ? ? ? while True:
? ? ? ? ? ? try:
? ? ? ? ? ? ? ? s.connect(("127.0.0.1", 8888))
? ? ? ? ? ? ? ? break
? ? ? ? ? ? except:
? ? ? ? ? ? ? ? print("等待服務(wù)器啟動(dòng)~")
? ? ? ? threadGame = threading.Thread(target=self.thread_body, name="Client")
? ? ? ? threadGame.start()
? ? ? ? return

? ? def thread_body(self):
? ? ? ? while True:
? ? ? ? ? ? data = s.recv(1024) ?# 等待接收服務(wù)器端信息
? ? ? ? ? ? if len(data) != 0:
? ? ? ? ? ? ? ? msg=data.decode()
? ? ? ? ? ? ? ? print("客戶端接收:", msg)
? ? ? ? ? ? ? ? msg = msg.split(",")
? ? ? ? ? ? ? ? #self.PaintPiece(int(msg[0]), int(msg[1]))
? ? ? ? ? ? ? ? #image = wx.StaticBitmap(self.panel, -1, self.picture[0], size=(40, 40))
? ? ? ? ? ? ? ? self.image[self.otherNum].SetPosition((int(msg[0]) * Cell + Cell / 2, int(msg[1]) * Cell + Cell / 2))
? ? ? ? ? ? ? ? self.otherNum += 1
? ? ? ? ? ? ? ? self.map[int(msg[0])][int(msg[1])] = "b"
? ? ? ? ? ? ? ? if self.win_lose("b"):
? ? ? ? ? ? ? ? ? ? self.one_Dialog("lose")
? ? ? ? ? ? ? ? self.IsGoGame=True
? ? ? ? ? ? #time.sleep(2)

? ? def one_Dialog(self, msg):
? ? ? ? if msg == "win":
? ? ? ? ? ? dlg = wx.MessageDialog(None, u"你勝利了!", u"恭喜", wx.YES_NO | wx.ICON_QUESTION)
? ? ? ? ? ? if dlg.ShowModal() == wx.ID_YES:
? ? ? ? ? ? ? ? self.Close(True)
? ? ? ? ? ? dlg.Destroy()
? ? ? ? if msg == "lose":
? ? ? ? ? ? dlg = wx.MessageDialog(None, u"你輸了!", u"很遺憾", wx.YES_NO | wx.ICON_QUESTION)
? ? ? ? ? ? if dlg.ShowModal() == wx.ID_YES:
? ? ? ? ? ? ? ? self.Close(True)
? ? ? ? ? ? dlg.Destroy()
? ? ? ? if msg == "notGo":
? ? ? ? ? ? dlg = wx.MessageDialog(None, u"等待對(duì)方下棋!", u"提示", wx.YES_NO | wx.ICON_QUESTION)
? ? ? ? ? ? if dlg.ShowModal() == wx.ID_YES:
? ? ? ? ? ? ? ? #self.Close(True)
? ? ? ? ? ? ? ? dlg.Destroy()

? ? # 判斷整個(gè)棋盤的輸贏
? ? def win_lose(self,msg):
? ? ? ? a = str(msg)
? ? ? ? print("a=", a)
? ? ? ? for i in range(0, 11):
? ? ? ? ? ? for j in range(0, 11):
? ? ? ? ? ? ? ? if self.map[i][j] == a and self.map[i + 1][j + 1] == a and self.map[i + 2][j + 2] == a and self.map[i + 3][
? ? ? ? ? ? ? ? ? ? ? ? ? ? j + 3] == a and self.map[i + 4][j + 4] == a:
? ? ? ? ? ? ? ? ? ? print("x=y軸上形成五子連珠")
? ? ? ? ? ? ? ? ? ? return True
? ? ? ? for i in range(4, 15):
? ? ? ? ? ? for j in range(0, 11):
? ? ? ? ? ? ? ? if self.map[i][j] == a and self.map[i - 1][j + 1] == a and self.map[i - 2][j + 2] == a and self.map[i - 3][
? ? ? ? ? ? ? ? ? ? ? ? ? ? j + 3] == a and self.map[i - 4][j + 4] == a:
? ? ? ? ? ? ? ? ? ? print("x=-y軸上形成五子連珠")
? ? ? ? ? ? ? ? ? ? return True
? ? ? ? for i in range(0, 15):
? ? ? ? ? ? for j in range(4, 15):
? ? ? ? ? ? ? ? if self.map[i][j] == a and self.map[i][j - 1] == a and self.map[i][j - 2] == a and self.map[i][j - 2] == a and self.map[i][
? ? ? ? ? ? ? ? ? ? ? ? ? ? j - 4] == a:
? ? ? ? ? ? ? ? ? ? print("Y軸上形成了五子連珠")
? ? ? ? ? ? ? ? ? ? return True
? ? ? ? for i in range(0, 11):
? ? ? ? ? ? for j in range(0, 15):
? ? ? ? ? ? ? ? if self.map[i][j] == a and self.map[i + 1][j] == a and self.map[i + 2][j] == a and self.map[i + 3][j] == a and \
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? self.map[i + 4][j] == a:
? ? ? ? ? ? ? ? ? ? print("X軸形成五子連珠")
? ? ? ? ? ? ? ? ? ? return True
? ? ? ? return False

# 應(yīng)用程序
class App(wx.App):
? ? def OnInit(self):
? ? ? ? frame=MyFrame()
? ? ? ? frame.Show()
? ? ? ? return True
? ? def OnExit(self):
? ? ? ? s.close() # 關(guān)閉socket對(duì)象
? ? ? ? return 0

# 進(jìn)入main函數(shù)運(yùn)行:循環(huán)
if __name__=="__main__":
? ? app=App()
? ? app.MainLoop()

以上就是本文的全部內(nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • Python搭建FTP服務(wù)器的方法示例

    Python搭建FTP服務(wù)器的方法示例

    本篇文章主要介紹了Python搭建FTP服務(wù)器的方法示例,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2018-01-01
  • python定時(shí)執(zhí)行指定函數(shù)的方法

    python定時(shí)執(zhí)行指定函數(shù)的方法

    這篇文章主要介紹了python定時(shí)執(zhí)行指定函數(shù)的方法,涉及Python中sleep方法延時(shí)執(zhí)行的相關(guān)使用技巧,需要的朋友可以參考下
    2015-05-05
  • 11個(gè)Python3字典內(nèi)置方法大全與示例匯總

    11個(gè)Python3字典內(nèi)置方法大全與示例匯總

    這篇文章主要給大家介紹了11個(gè)Python3字典內(nèi)置方法大全與示例的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家學(xué)習(xí)或者使用Python具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-05-05
  • 深入理解python中的atexit模塊

    深入理解python中的atexit模塊

    atexit模塊很簡單,只定義了一個(gè)register函數(shù)用于注冊(cè)程序退出時(shí)的回調(diào)函數(shù),我們可以在這個(gè)回調(diào)函數(shù)中做一些資源清理的操作。下面這篇文章主要介紹了python中atexit模塊的相關(guān)資料,需要的朋友可以參考下。
    2017-03-03
  • 一步真實(shí)解決AttributeError:‘Upsample‘?object?has?no?attribute‘recompute_scale_factor‘的問題

    一步真實(shí)解決AttributeError:‘Upsample‘?object?has?no?attribute‘

    這篇文章主要介紹了解決解決AttributeError:?‘Upsample‘?object?has?no?attribute?‘recompute_scale_factor‘的問題,本文給大家介紹的非常想詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2023-06-06
  • django 連接數(shù)據(jù)庫 sqlite的例子

    django 連接數(shù)據(jù)庫 sqlite的例子

    今天小編就為大家分享一篇django 連接數(shù)據(jù)庫 sqlite的例子,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧
    2019-08-08
  • tensorflow多維張量計(jì)算實(shí)例

    tensorflow多維張量計(jì)算實(shí)例

    今天小編就為大家分享一篇tensorflow多維張量計(jì)算實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧
    2020-02-02
  • 離線狀態(tài)下在jupyter notebook中使用plotly實(shí)例

    離線狀態(tài)下在jupyter notebook中使用plotly實(shí)例

    這篇文章主要介紹了離線狀態(tài)下在jupyter notebook中使用plotly實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧
    2020-04-04
  • Python字典“鍵”和“值”的排序5種方法

    Python字典“鍵”和“值”的排序5種方法

    這篇文章主要介紹了5種Python字典“鍵”和“值”的排序方法,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2023-03-03
  • Python之指數(shù)與E記法的區(qū)別詳解

    Python之指數(shù)與E記法的區(qū)別詳解

    今天小編就為大家分享一篇Python之指數(shù)與E記法的區(qū)別詳解,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧
    2019-11-11

最新評(píng)論