读取文件cdays−4-test.txt 内容,去除空行和注释行后,以行为单位进行排序,并将结果输出为cdays−4-result.txt. cdays−4-test.txt的内容 #some words Sometimes in life, You find a special friend; Someone who changes your life just by being part of it. Someone who makes you laugh until you can't s…
计算今年是否是闰年.判断闰年条件,满足年份模400 为0,或者模4 为0 但模100不为0. def is_learp_year(year): """判断年份是否为润年""" flag = False if year % 400 == 0 or (year % 4 == 0 and year % 100 != 0): flag = True return flag 利用Python 作为科学计算器的特性,熟悉Python 中的常用运算符,并分别求…