下面代码的输出结果是() n=2 def f(): n =bool(a-2) return n b= f(2) print(n, b)
A: 2 0
B: 0 True
C: 2 False
D: 0 False
A: 2 0
B: 0 True
C: 2 False
D: 0 False
举一反三
- 写出下列语句的输出结果:print(1 or 2, 0 or 2, False or True,True or False,False or 2,sep=' ')print(1 and 2, 0 and 2, False and 2,True and 2,False and True,sep=' ')
- 下面哪个表达式在n是偶数时,计算结果是True? A: mod n 2 B: mod n 2 = 0 C: n `mod` 2 == 0 D: mod 2 n == 0
- def f(x,n = 2): return(x**n)print(f(5))print(f(3,3))
- 智慧职教: def f(n): if n==0: return 0 elif n==1: return 1 return f(n-1)+f(n-2) print(4) 结果是
- vallist=listOf(0,1,2,3,4,5,6,7),println(list.any{it%2==1}输出什么?() A: 是1\n B: 是0\n C: TRUE\n D: FALSE