上一页 1 ··· 42 43 44 45 46 47 48 49 50 ··· 52 下一页
摘要: Python: #计算并输出1~100之间的奇数之和与偶数之和 from functools import reduce print("evenSum=",end='') print(reduce(lambda a, b: a + b, filter(lambda i: i%2 == 0, [i f 阅读全文
posted @ 2020-05-29 14:13 profesor 阅读(3985) 评论(0) 推荐(0) 编辑
摘要: 1. #快速生成1,2,3,..., 100数字列表: print([i for i in range(1,101)]) 2. #快速生成001,002,003,...,100数字列表: print([f"{i:03}" for i in range(1,101)]) 或者不用f-string pr 阅读全文
posted @ 2020-05-29 09:07 profesor 阅读(2290) 评论(0) 推荐(1) 编辑
摘要: Java import java.util.Scanner; public class compare { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.print 阅读全文
posted @ 2020-05-29 08:57 profesor 阅读(602) 评论(0) 推荐(0) 编辑
摘要: 用Python处理/生成JSON文件 先看个python list/array: my_list = [ {"Jerry": {"job": "comedian", "age": 34, "married": True,},}, {"Elaine": {"job": "housewife", "ag 阅读全文
posted @ 2020-05-28 16:14 profesor 阅读(560) 评论(0) 推荐(0) 编辑
摘要: String.format(); System.out.printf(); System.out.format() 阅读全文
posted @ 2020-05-27 11:02 profesor 阅读(282) 评论(0) 推荐(0) 编辑
摘要: JAVA: import static java.lang.System.out; public class Ternary { public static void main(String[] args) { int a = 4, b = 5; out.println(++a == b-- ? a 阅读全文
posted @ 2020-05-27 09:45 profesor 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 体会宏的定义方法 阅读全文
posted @ 2020-05-27 09:31 profesor 阅读(1265) 评论(0) 推荐(0) 编辑
摘要: Python ONE-LINER LIST COMPREHENSION 阅读全文
posted @ 2020-05-27 08:41 profesor 阅读(189) 评论(0) 推荐(0) 编辑
摘要: JAVA public class Args { public static void main(String[] args) { // for (String arg : args) // System.out.println(arg); //或者下面的遍历方法 for (int i = 0; i 阅读全文
posted @ 2020-05-26 23:38 profesor 阅读(190) 评论(0) 推荐(0) 编辑
摘要: /* 典型的Switch-case程序题: 成绩等级划分: >= 90 A >= 80 B >= 70 C >= 60 D < 60 E */ import java.util.Scanner; public class SwitchInt { public static void main(Str 阅读全文
posted @ 2020-05-26 10:47 profesor 阅读(1096) 评论(0) 推荐(0) 编辑
上一页 1 ··· 42 43 44 45 46 47 48 49 50 ··· 52 下一页