摘要: 描述 map() 会根据提供的函数对指定序列做映射。 第一个参数 function 以参数序列中的每一个元素调用 function 函数,返回包含每次 function 函数返回值的新列表。 语法 map() 函数语法: map(function, iterable, ...) 参数 functio 阅读全文
posted @ 2020-02-18 15:26 秦_殇 阅读(105) 评论(0) 推荐(0) 编辑
摘要: Python2.6 开始,新增了一种格式化字符串的函数 str.format(),它增强了字符串格式化的功能。 基本语法是通过 {} 和 : 来代替以前的 % 。 format 函数可以接受不限个参数,位置可以不按顺序。 >>>"{} {}".format("hello", "world") # 不 阅读全文
posted @ 2020-02-18 15:19 秦_殇 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 1 概述 <sstream> 定义了三个类:istringstream、ostringstream 和 stringstream,分别用来进行流的输入、输出和输入输出操作。本文以 stringstream 为主,介绍流的输入和输出操作。 <sstream> 主要用来进行数据类型转换,由于 <sstr 阅读全文
posted @ 2020-02-18 12:00 秦_殇 阅读(1402) 评论(0) 推荐(0) 编辑
摘要: 转跳点:🐏 1001 A+B Format (20分) Calculate a+b and output the sum in standard format -- that is, the digits must be separated into groups of three by comm 阅读全文
posted @ 2020-02-18 10:58 秦_殇 阅读(190) 评论(0) 推荐(0) 编辑