随笔分类 - Program
摘要:1 #定义一个方法 func,该func可以引入任意多的整型参数,结果返回其中最大与最小的值。 2 def func1(*nums): 3 for i in nums: 4 if not isinstance(i,int): 5 return '无法比较,请保证全部是整数!' 6 #要使函数执行到这里时结束,比较...
阅读全文
摘要:1 import random as r 2 3 class Turtle: 4 def __init__(self): 5 self.power = 100 #初始化体力 6 self.tx = r.randint(0,10) 7 self.ty = r.randint(0,10)#随机出场位置 8 ...
阅读全文
摘要:1 import easygui as g 2 import os 3 4 def show_result(path): 5 text='' 6 total=0 7 for each_ext in ext_dict: 8 total += ext_dict[each_ext] 9 text += '【%s】源文件有【%d...
阅读全文

浙公网安备 33010602011771号