摘要: 1.带时区的日期时间:ZoneId / ZonedDateTime (1)ZoneId public void test1(){ Set<String> zoneIds = ZoneId.getAvailableZoneIds(); //获取所有时区 for (String zoneId : zon 阅读全文
posted @ 2022-12-06 16:13 植树chen 阅读(176) 评论(0) 推荐(0)
摘要: python内置了多种类型的数据结构,最常用包括:列表、元组、集合和字典。 1.列表list 有序,可通过索引查找 list1 = [1,3,5,7,100] list2 = ['hello']*3 #表示为:['hello','hello','hello'] print(len(list1)) # 阅读全文
posted @ 2022-12-06 14:32 植树chen 阅读(162) 评论(0) 推荐(0)
摘要: 1.字符串 字符串用单引号或双引号包围起来,三个双引号或三个单引号开头的字符串可以换行。 s1 = 'hello,world' s2 = "hello,world" s3 = '''hello, money, rice''' s3 = """hello, world""" 2.转义字符 在字符串中使 阅读全文
posted @ 2022-12-06 14:24 植树chen 阅读(525) 评论(0) 推荐(0)
摘要: 1.最大公约数 最大公因子,指两个或多个整数共有约数中最大的一个。如(12,16)的公约数有1,2,4,最大的为4。 def gcd(x, y): (x, y) = (y, x) if x > y else (x, y) for factor in range(x, 0, -1): if x % f 阅读全文
posted @ 2022-12-06 09:24 植树chen 阅读(498) 评论(0) 推荐(0)