Python学习手册——笔记一
来源:互联网 发布:php 单引号 引用变量 编辑:程序博客网 时间:2024/05/21 02:19
Python常用类型
其中list、set、dict为可变类型还有一个关于Python对象引用的困惑的例子。明白了这个对象引用就理解了。
>>> a = 1>>> type(a)<class 'int'>>>> a = 1.0>>> type(a)<class 'float'>>>> a = 'abcd'>>> type(a)<class 'str'>>>> a = (1,2)>>> type(a)<class 'tuple'>>>> a = [1, 2];>>> type(a)<class 'list'>>>> a = {1, 2}>>> type(a)<class 'set'>>>> a = {1:1, 2:2}>>> type(a)<class 'dict'>
其中list、set、dict为可变类型还有一个关于Python对象引用的困惑的例子。明白了这个对象引用就理解了。
>>> S1 = 'spam'>>> S2 = 'spam'>>> S1 == S2, S1 is S2(True, True)>>> S1 = 'a longer string'>>> S2 = 'a longer string'>>> S1 == S2, S1 is S2(True, False)
- Python学习手册——笔记一
- python 菜鸟成长笔记(一)Python学习手册
- Python学习手册笔记
- python学习手册笔记
- 《Python学习手册》学习笔记——第4章
- 《Python学习手册》学习笔记——第5章
- 【Python 学习手册笔记】数字
- Python模块学习之字符串方法——Python学习手册笔记
- 【Python 学习手册笔记】Python 语句简介
- Python自学手册笔记(一)
- 《python学习手册》之学习笔记1
- Python 学习手册(第四版)学习笔记(一)序言
- 《Python学习手册》——使用入门
- [Python]python学习笔记(一)——语法
- python 学习笔记——python 装饰器(一)
- Python学习笔记(一)——Python初体验
- Python学习笔记(一)——Python基础
- Python学习笔记【一】——《python基础教程》::基础知识
- myeclipse快捷键
- 杭电Hd 2106 decimal system
- 百度索引量与网站降权的基本解决方法
- AD77程序——9——2
- 身份证阅读器读相片经常一片白色
- Python学习手册——笔记一
- ENVI中的数据类型
- pymol 知道多少?pymol技巧汇总
- maven出现(请使用-source 5 或者更高版本以启用XX)问题解决
- ubuntu常用命令
- Hive 随谈(六)– Hive 的扩展特性
- nginx启动,重启,关闭命令
- mysql中的汉字为乱码
- Aptana:JavaScript开发利器