Section 2 Dictionary

1. Dictionary: a={'name':'wang','age':88}

2, a is str

a.capitalize : Capitalize the first letter

a.center(3, '*'): Center the content in a, with 3 * on the left and right

a.count('j',1:4): count the number of times j appears in 1 to 4

a.endwith('name'): Does a end with name

a.startwith('name'): Does a start with name

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324892082&siteId=291194637