更多“写出下面代码的运行结果() def fun(): x = 5 x=x+3 x = 3 fun() x=x+2 print(x)”相关的问题
第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 mysum(*p): return sum(p) print(mysum (3, 5, 8))
点击查看答案
第5题
写出下面代码的运行结果。def demo(lst, k): if k<len(lst): return lst[k:]+lst[:k] lst=[1,2,3,4,5,6] print(demo(lst,4))
点击查看答案
第6题
写出下面代码的运行结果() def fun(a): a=a+1 return a a=fun(1) b=fun(a) print(a,b)
点击查看答案
第7题
写出下面代码的运行结果。def addInterest(balance,rate): newBalance=balance*(1+rate) balance=newBalance def main(): amount=1000 rate=0.05 addInterest(amount,rate) print (amount) main()
点击查看答案
第8题
写出下面代码的运行结果() def mysum(x,y): return(x+y-2) for i in range(5): print(mysum(i,3),end='')
A.54321
B.01234
C.45678
D.12345
点击查看答案
第9题
【单选题】写出下面代码的运行结果。 def Sum(a, b=3, c=5): print(a,b,c) Sum(a=8, c=2)
点击查看答案