摘要: 1. 简单列表解析 假设我们需要创建一个列表为:[0,0,0,0,0,0, 0,0,0, 0](size=10) 显然这样写0很费劲。所以有一种叫做列表解析的东西可以快速生成: >>> [0 for i in range(10)] [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # 还 阅读全文
posted @ 2020-02-26 23:23 SheepCore 阅读(1678) 评论(0) 推荐(0) 编辑
摘要: 1. rstrip()方法,去掉字符串结尾空格 >>> name = "Sheep Core " >>> name.rstrip() 'Sheep Core' #已经去掉末尾空格 note: r 表示 right! 补充: 2. lstrip() 方法,去掉字符串开头空格 >>> name = " 阅读全文
posted @ 2020-02-26 22:32 SheepCore 阅读(12899) 评论(0) 推荐(1) 编辑
摘要: // 2020-02-26 1. polynomials -- 多项式 2. exponents and coefficients -- 指数和系数 3. 1 decimal place -- 小数点后一位 阅读全文
posted @ 2020-02-26 21:58 SheepCore 阅读(322) 评论(0) 推荐(0) 编辑
摘要: 1.Description: 2.Example: Input:2 1 2.4 0 3.2 2 2 1.5 1 0.5output:3 2 1.5 1 2.9 0 3.2 3.Solutions: C++ Version: 1 #include<iostream> 2 #include<map> 3 阅读全文
posted @ 2020-02-26 21:45 SheepCore 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 1. 使用Scanner读取字符和字符串 3 /** 4 * Created by SheepCore on 2020-2-26 5 */ 7 public class Main { 8 public static void main(String[] args) { 9 Scanner scan 阅读全文
posted @ 2020-02-26 13:48 SheepCore 阅读(9764) 评论(0) 推荐(0) 编辑