已知函数定义如下:def show(numbers):for n in numbers:print(n)下面那些在调用函数时会报错( )
A: show([2,3,4,5])
B: show((2,3,4,5))
C: show(2,3,4,5)
D: show("2345")
A: show([2,3,4,5])
B: show((2,3,4,5))
C: show(2,3,4,5)
D: show("2345")
举一反三
- 已知函数定义def demo(a,*b):return b则print(demo(2,3,4,5))输出什么? A: 2 B: (2, 3) C: (2, 3, 4) D: (3, 4, 5)
- 函数如下: def showNnumber(numbers): for n in numbers: print(n) 下面那些在调用函数时会报错
- 下列程序的运行结果是______。 public class Test { public static void main (String[] args) { int x=3, y=4, z=5; if (x>3) { if (y<2) System.out.print ("show one"); else System.out.print ("show two"); } else{ if (z>4) System.out.print ("show three"); else System.out.print ("show four"); } } } A: show one B: show two C: show three D: show four
- 下列程序的运行结果? public class Test { public static void main(String a[]) { int x=3,y=4,z=5; if (x>3) { if (y<2) System.out.println("show one"); else System.out.println("show two"); } else { if (z>4) System.out.println("show three"); else System.out.println("show four"); } } }
- 给出以下4个重载的方法show,调用show方法时,下面哪个说法是错误的()(1)show(inta,intb,intc)(2)show(inta,intb,doublec)(3)show(inta,doubleb,doublec)(4)show(doublea,doubleb,intc)