当前位置:网站首页>Variable and immutable data types
Variable and immutable data types
2022-07-24 18:15:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
Python Medium data type
With Python3 For example ,Python3 There are several standard data types in
Number( Numbers )
Bool ( Boolean value )
String( character string )
List( list )
Tuple( Tuples )
Sets( aggregate )
Dictionary( Dictionaries )The basis for dividing variable and immutable types
Variable data type
Variable data type :value Value change ,id The value remains the same Immutable data types
Immutable data types :value Value change ,id The value also changes How to determine whether the data type is variable or immutable
According to the concept of variable data type and immutable data type , Just change value When it's worth it , Use id() Function to view variables id Whether the value changes can tell whether this data type is variable or immutable
num = 10
print(id(num)) #1388664736
num2 = 20
print(id(num2)) #1388664736From the above example, we can draw a conclusion :num Is numeric type , Numeric types are immutable data types ; Other data types use id() Function can draw a conclusion .
Variable data types contain content
Dictionary( Dictionaries )List( list )Immutable data types contain content
Number( Numbers )String( character string )Tuple( Tuples )
Bool( Boolean value )Divided by access type
Direct access : Numbers
Sequential access : character string list Tuples
Map access : Dictionaries Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/124473.html Link to the original text :https://javaforall.cn
边栏推荐
- int8 & int8,你栽过这样的跟头吗?
- 0611~ self study class
- 再见收费的Navicat!这款开源的数据库管理工具界面更炫酷!
- 仅需一个依赖给Swagger换上新皮肤,既简单又炫酷!
- redis集群的三种方式
- Stream, file, IO
- 0630~ professional quality course
- Get the original data API on 1688app
- 0616项目二结束~~总总结
- The drop-down list component uses iscrol JS to achieve the rolling effect of the pit encountered
猜你喜欢

Interview assault 66: what is the difference between request forwarding and request redirection?

Wechat applet

T245982 "kdoi-01" drunken flower Yin

Install jumpserver

下拉列表组件使用 iScroll.js 实现滚动效果遇到的坑

The ability to detect movement in vivo and build a safe and reliable payment level "face brushing" experience

Section 7 Data Dictionary: hash followed by Daewoo redis ------- directory post

【刷题记录】20. 有效的括号

Three ways of redis cluster

Inheritance and Derive
随机推荐
0625~<config>-<bus>
0623~放假自习
下拉列表组件使用 iScroll.js 实现滚动效果遇到的坑
T245982 「KDOI-01」醉花阴
0623~ holiday self study
0701~ holiday summary
0621~ES&Lucene
Section 11 cache avalanche, hot data failure follow Daewoo redis ------- directory post
[verification] only numbers (positive and negative numbers) can be entered
File upload vulnerability -.User.ini and.Htaccess
Flink operation Hudi data table
JumpServer的使用
Alibaba /166 obtains the API instructions for all products in the store
Common methods of array (2)
0625~<config>-<bus>
Blackmagic Fusion Studio 18
0611~ self study class
Example of single table query in ORM student management system
Section 7 Data Dictionary: hash followed by Daewoo redis ------- directory post
Mac database management software Navicat premium essentials mac