自由式学习
1人加入学习
(0人评价)
Python基础知识学习
价格 免费
该课程属于 朴嗣明---算法方向---弱监督 请加入后再学习

s ='test.com'

l = list(s) --> ['t', 'e', 's', 't', '.', 'c', 'o', 'm']

l[-1] = 'n' --> ['t', 'e', 's', 't', '.', 'c', 'o', 'n']

s = ''.join(l) --> 'test.con'

s = '3'.join(l) --> 't3e3s3t3.3c3o3n'

url = 'getronics.com,yahoo.co.jp,nikkei.com'

type(url) --> <class 'str'>

url = url.split(',') --> ['getronics.com', 'yahoo.co.jp', 'nikkei.com']

type(url) --> <class 'list'>

url = 'getronics.com'

url.startswith('g') --> True

url.endswith('com') --> True

url.find('getronics') --> 0

url.find('com') --> 10

a,b = 1,2 a -->1, b--> 2

'{0} --> {1}'.format(a,b) --> '1 --> 2'

'{name} --> {age}'.format(name = 'jerry', age = '100') --> 'jerry --> 100'

('{name} --> {age}'.format(name = 'jerry', age = '100')).upper() --> 'JERRY --> 100'

[c*3 for c in 'CODE'] --> ['CCC', 'OOO', 'DDD', 'EEE']

['nikkei.com'] * 3 --> ['nikkei.com', 'nikkei.com', 'nikkei.com']

l = ['nikkei.com']

l.extend(['test.com', 'getronics.com']) --> ['nikkei.com', 'test.com', 'getronics.com']

l[0] --> 'nikkei.com'

l[1] --> 'test.com'

l = ['nikkei.com']

l.append(['test.com', 'getronics.com']) --> ['nikkei.com', ['test.com', 'getronics.com']]

l[0] --> 'nikkei.com'

l[1] --> ['test.com', 'getronics.com']

l.sort(), l.reverse(),

l.index('nikkei.com') --> 0

l.count('nikkei.com') --> 1

 

l1 = [1, 2, 3, 4, 5]

l2 = l1

l2 --> [1, 2, 3, 4, 5]

l1[0] = 10

l2 --> [10, 2, 3, 4, 5]

 

l2 = l1[:] or l2 = l1.copy()

l1[0] = 11 --> [11, 2, 3, 4, 5]

l2 --> [10, 2, 3, 4, 5]

 

 

 

 

 

[展开全文]

授课教师

高级算法工程师
老师

课程特色

视频(61)
考试(14)
练习(12)

最新学员