原创 Python os模塊常用函數使用方法大全
# -*-coding: utf-8 -*- import os import shutil ''' OS模塊簡單的來說它是一個Python的系統編程的操作模塊,可以處理文件和目錄這些我們日常手動需要做的操作。 ''' #-------
原创 Python函數使用匯總
# -*- coding: utf8 -*- #不帶參數函數 def fun(): print('hello world') fun() #hello world #------------------------------
原创 python 元組tuple
# -*- coding: utf8 -*- """ 元組的相關測試, 基本和列表一模一樣,除了元素不能被修改,元組用小括號括起,實際起作用的是逗號 """ #定義 #空元組 tuple1 = () #創建一個元素,和列表有所區別 tu
原创 python 類class 彙總
: : (nameage): .name = name .__age = age (say): (% say) (): (% (.name.__age)) .__
原创 python 字符串
# -*- coding: utf-8 -*- #三引號可以用來多行註釋 str1 = 'a' str2 = "b" str3 = '''b cd deff''' print(str1) #a print(str2) #b prin
原创 python os模塊常用函數使用方法大全
# -*-coding: utf-8 -*- import os import shutil ''' OS模塊簡單的來說它是一個Python的系統編程的操作模塊,可以處理文件和目錄這些我們日常手動需要做的操作。 ''' #-------
原创 python re 正則表達式學習總結
# -*- coding: utf-8 -*- import re import os #------------------------------------- re(正則表達式)模塊 ------------------------
原创 python 字符串
# -*- coding: utf-8 -*- #三引號可以用來多行註釋 str1 = 'a' str2 = "b" str3 = '''b cd deff''' print(str1) #a print(str2) #b prin
原创 python 字典dict
# -*- coding: utf-8 -*- # ****************************** 創建 *************************** dict1 = {} #定義1個元素的字典 dict2 =
原创 python 集合set
# -*- coding: utf-8 -*- #無序不重複 set1 = {} str = 'dsfhadfhhjdsfewhiufewhfewf' set2 ={1,2,3,4,5,6,7,89,9,9,9,9} print(set
原创 python 列表list
# -*- coding: utf-8 -*- #創建空的list列表 list1 = [] #創建一個元素 listOne = ['hello'] listOne2 = list(['hello']) print(listOne)