日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

access数据类型百度百科_Day 7 基本数据类型

發布時間:2024/1/23 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 access数据类型百度百科_Day 7 基本数据类型 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一 列表補充 Lists

需要掌握的其它命令

index

Returns the index of the first element with the specified value

count

Returns the number of elements with the specified value

extend

Add the elements of a list (or any iterable), to the end of the current list

reverse

Reverses the order of the list

sort

Sorts the list

二 元組 Tuples

1.定義 Definition

Tuples are written with round brackets, elements in tuples are separated by commas

Notice that you should add a comma in the brackets if there is only one element in a tuple

A tuple is a collection which is ordered and unchangeable.

2.作用 Usage

Tuples are used to store multiple items in a single variable.

3.優先掌握的操作

Similar to the previous list

三 字典 Dictionary

1.定義 Definition

A dictionary is a collection which is unordered, changeable and does not allow duplicates.

Dictionaries are written with curly brackets, and have keys and values,and can be referred to by using the key name.

2.作用 Usage

Dictionaries are used to store data values in key:value pairs.

3.特點 Characteristic

Changeable

可變類型

Unordered

無序

Duplicates Not Allowed

Dictionaries cannot have two items with the same key:

4.數據轉化 Convert

可以將含有嵌套的部分列表轉為字典

5.需要掌握的操作

取值 Access items

You can access the items of a dictionary by referring to its key name, inside square brackets:

The keys() method will return a list of all the keys in the dictionary

通過get取值 Access items by "get"

This method is similar to the previous one, but if the key you input were not in the dictionary, it could return the value "None"

Update

Updates the dictionary with the specified key-value pairs

Setdefault

Returns the value of the specified key. If the key does not exist: insert the key, with the specified value

補充了解

1.深淺拷貝

Shallow copy and Deep copy

# from copy import deepcopy

import copy

?

l = [11, 22, [111, 222]]

new_l = l.copy()

new2_l = copy.deepcopy(l)

l[2][0] = 333

# 改變原列表的字列表中的一個值,觀察新列表的變化

print("原列表", l)

# 淺拷貝得到的列表會隨著原列表而改變

print("淺拷貝新列表", new_l)

# 而深拷貝得到的列表不會改變

print("深拷貝新列表", new2_l)

2.列表為什么沒有find命令

3.hash

A hash is a function that converts one value to another. Hashing data is a common practice in computer science and is used for several different purposes. Examples include cryptography, compression, checksum generation, and data indexing.

Hash算法可以將一個數據轉換為一個標志,這個標志和源數據的每一個字節都有十分緊密的關系。Hash算法還具有一個特點,就是很難找到逆向規律。

具體請見百度百科:

總結

以上是生活随笔為你收集整理的access数据类型百度百科_Day 7 基本数据类型的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。