python程序设计基础第二版课后答案(python程序设计基础课本)

您所在的位置:网站首页 python程序设计基础第二版答案 python程序设计基础第二版课后答案(python程序设计基础课本)

python程序设计基础第二版课后答案(python程序设计基础课本)

2022-09-30 12:53| 来源: 网络整理| 查看: 265

Python

在Python中一切都是对象。对象要分三类:内置对象、标准库对象、扩展库对象。内置对象和标准库对象是 Python 运行程序自带的,在安装 Python 运行程序时同时安装了。而扩展库对象不是 Python 运行程序自带的,需要先安装才能使用。

今天小编为大家介绍python常用的内置对象以及他们的简单运用,运用IDLE交互模式,快速返回。

常用内置对象包括数字、字符串、列表、字典、元组、集合、布尔型,还有一些不常用的对象,比如zip,map等。

数字(int),即阿拉伯数字。可以进行简单运算,加、减、乘、除、取余等。

python程序设计基础(二)

字符串(str),引号为定界符,可进行拼接。

python程序设计基础(二)

列表(list),方括号为界,其中元素用逗号隔开。列表功能强大,可拼接、增加、删减、取值等功能。

python程序设计基础(二)

字典(dict),以大括号为界,元素之间用逗号分隔,而元素以“键:值”形式存在,可按键进行查看。

python程序设计基础(二)

元组(tuple),以小括号为界,逗号为分隔符,当元素只有一个时,元素逗号不能省略。

python程序设计基础(二)

集合(set),以大括号为界,逗号为分隔符。其中元素不可重复

布尔型(bool),表达式的值-Ture,False。

python程序设计基础(二)

英文翻译

Everything in Python is an object. There are three types of objects: built-in objects, standard library objects, and extended library objects. The built-in objects and standard library objects come with the Python runtime program and are installed at the same time when the Python runtime program is installed. The extension library object is not included in the Python running program, and needs to be installed before it can be used.

Today, I will introduce you to the commonly used built-in objects of python and their simple use, using the IDLE interactive mode to quickly return.

Commonly used built-in objects include numbers, strings, lists, dictionaries, tuples, sets, booleans, and some less commonly used objects, such as zip, map, etc.

Number (int), namely Arabic numerals. You can perform simple operations such as addition, subtraction, multiplication, division, remainder, etc.

String (str), quotation marks are delimiters, can be spliced.

The list is bounded by square brackets, and the elements are separated by commas. The list function is powerful, and can be spliced, added, deleted, valued and other functions.

A dictionary (dict) is bounded by curly braces, and the elements are separated by commas, and the elements exist in the form of "key: value", which can be viewed by pressing the key.

Tuples are bounded by parentheses and commas as separators. When there is only one element, the element comma cannot be omitted.

Set, bounded by braces, and comma as separator. The elements are not repeatable.

Boolean (bool), the value of the expression-True, False.

参考资料:菜鸟教程

翻译:Google翻译

本文由LearningYard新学苑原创,部分图片文字来自网络,如有侵权请联系。

免责声明:

一、71爱课网旨在免费为用户传递信息,不代表本站的观点和立场;

二、71爱课网仅提供信息发布平台,对于本文版权归属问题本站无法判断和调查;

三、本文整理于会员新闻,如果侵犯您的版权,请联系管理员删除或增加版权信息(QQ:981561103)。



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3