下面程序段的输出为def f1(a,b,c): print(a+b)nums=(1,2,3)f1(nums)? 语法错|1|3|6
举一反三
- Python中,若def f1(a,b,c):print(a+b),则nums =(1,2,3);f1(*nums)的程序运行结果是_____
- 下面代码运行结果是什么?( ) nums=[1,2,3,4,5] nums[3]=nums[1] print(nums[3])
- 下面代码结果是什么?( ) nums=[10,9,8,7,6,5] nums[0]=nums[1]-5 if 4 in nums: print(nums[3]) else: print(nums[4])
- 10603.下面程序段的输出为 a=1 def fun(a): a=a+2 print(a) fun(a) print(a) A: 3 1 B: 1 1 C: 4 1 D: 3 3
- What does the following code print?def f1(x=1, y=2): x = x+y y+=1 print(x,y)f1() A: 1 3 B: 3 1 C: 3 3 D: error