摘要:
调用类报错,具体如下 TypeError: unbound method submit() must be called with jinjin instance as first argument (got float instance instead) 后来解决方法:在类名称后边加括号() 由于 阅读全文
摘要:
1、split(' '),''号中间是空格 def break_words(stuff): """This function will break up words for us""" words=stuff.split(' ') return words 返回的words应该是This funct 阅读全文
摘要:
1、脚本 def add(a,b): return (a+b)def div(a,b,c): return (a/b-c)x = div(34,100,1023)y = add(24,x)print ("the result is %f" %y) print ("the result is %d" 阅读全文
摘要:
1、脚本 def max(a,b,c): x = a if (a<b): x=b if (b<c): x=c print ("the max num is %d" %x) def hello(list): list.append([1,2,3,4]) print(list) return list 阅读全文
摘要:
1、脚本 from sys import argv script,filename = argv#以读的模式打开txt文件txt = open(filename,'r+')print ("the filename is %s" %filename)print ("the following is r 阅读全文