程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python learning (2) - Basic Syntax (string, list, tuple)

編輯:Python

1 character string

1.1 String definition

 The quoted content is the string .
stay python in , String can be multiplied by ⼀ It's an integer ,
character string * num

1.2 String output and output

# transport ⼊ input()
input() The function gets a string
# Output print() function %s
f-string

1.3 Subscript

1.4 cut ⽚

my_str[:] Get and original ⼀ What kind of string
my_str[::-1] Inversion of string


1.5 lookup ⽅ Law

find() & rfind()

index & rindex()

count()

1.6 String substitution ⽅ Law replace

1.7 String delimitation split()


1.8 String connection join()

2 list

2.1 The definition and basic of the list make ⽤

2.2 Traverse

2.3 Add data to the list

2.4 Data query operations in the list

2.5 Delete from the list

2.6 List sorting and inversion

2.7 List nesting

3. Tuples


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved