一、Python对象
1.理解变量、操作符、关键字和对象的意义和重要性
2.在程序中使用数字和分数
3.字符串的重要性
4.理解字符串的切片和索引
5.使用列表和元组
6.理解元组的重要性
变量:储存值
Python任何东西都是对象。
对象都有标识、类型和值。
在Python中,标识指的是地址,不会改变。
类型可以是None、数字(整数、浮点数、复数、集合)、序列(字符串、元组、列表、集合)
字符串:字符串是 Python 中最常用的数据类型。使用引号( ’ 或 " )来创建字符串。
关键字:and, del, from, not, while, as, elif, global,else, if, pass, Yield, break, except, import, class, raise,continue, finally, return, def, for, and try等等
操作符:
算术操作符:+, –, *, /, %, ** and //
赋值运算符: =, + =, – =, *=, /=, %=, **= and //=
逻辑运算符:or, and, and not
关系运算符:<, <=, >, >=, != or < > and ==
列表:list = [1, 2, 3, 4, 5 ]
元组:tup = (1, 2, 3, 4, 5 )
字典:dict = {‘Alice’: ‘241’, ‘Beth’: ‘912’, ‘Cecil’: ‘328’}
集合:basket = {‘a’, ‘o’, ‘a’, ‘p’, ‘o’, ‘b’}
Python3笔记1
最新推荐文章于 2024-02-10 17:11:54 发布