更多“写出下面代码的运行结果() def fun(*p): return sum(p) a=1 b=2 c=3 print(fun (a, b, c))”相关的问题
第1题
写出下面代码的运行结果。(多个结果用逗号隔开) def demo(): x = 5 x = 3 demo() print(x)
点击查看答案
第2题
写出下面代码的运行结果() def demo(a,b,c): print(a+b+c) s=[1,2,3] demo(*s)
点击查看答案
第3题
写出下面代码的运行结果。def foo(s): if s=="": return s else: return s[1:]+s[0] print(foo('Happy New Year!'))
点击查看答案
第4题
写出下面代码的运行结果。def demo(lst, k): if k<len(lst): return lst[k:]+lst[:k] lst=[1,2,3,4,5,6] print(demo(lst,4))
点击查看答案
第5题
写出下面代码的运行结果() def mysum(*p): return sum(p) print(mysum (3, 5, 8))
点击查看答案
第6题
写出下面代码的运行结果() def test(): global g g=g+2 return g g=10 print(test())
点击查看答案
第7题
写出下面代码的运行结果。(多个结果用逗号隔开) def Sum(*p): return sum(p) print(Sum(3, 5, 8)) print(Sum(8)) print(Sum(8, 2, 10))
点击查看答案
第8题
写出下面代码的运行结果() def fun(): x = 5 x=x+3 x = 3 fun() x=x+2 print(x)
点击查看答案
第9题
写出下面代码的运行结果。def addInterest(balance,rate): newBalance=balance*(1+rate) balance=newBalance def main(): amount=1000 rate=0.05 addInterest(amount,rate) print (amount) main()
点击查看答案