Python Basics - Summary

####################### tidy#################

# 1. Numbers
# int(..)


# 二、字符串
# replace/find/join/strip/startswith/split/upper/lower/format
# tempalte = "i am {name}, age : {age}"
# # v = tempalte.format(name='alex',age=19)
# v = tempalte.format(**{"name": 'alex','age': 19})
# print(v)


# 3. List
# append, extend, insert
# Index, slice, loop


# 4. Tuples
# Ignore
# Indexes, slices, loops, and elements cannot be modified


# Five, dictionary
# get/update/keys/values/items
# for, index

# dic = {
# "k1": 'v1'
# }

# v = "k1" in dic
# print(v)

# v = "v1" in dic.values()
# print(v)
# Six, boolean value
# 0 1
# bool(...)
# None "" () [] {} 0 ==> False

Guess you like

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