在python3.x执行下列选项的程序,不会抛出异常的是()
b = 1def fn(): nonlocal b b = b + 1 print(b)fn()
b = 1
def fn():
nonlocal b
b = b + 1
print(b)
fn()
tup = (('onion','apple'),('tomato','pear'))for _,fruit in tup: print(fruit)
tup = (('onion','apple'),('tomato','pear'))
for _,fruit in tup:
print(fruit)
a = [b for b in range(10) if b % 2 == 0]print(b)
a = [b for b in range(10) if b % 2 == 0]
lis = [1,2,'a',[1,2]]set(lis)
lis = [1,2,'a',[1,2]]
set(lis)
这道题你会答吗?花几分钟告诉大家答案吧!
扫描二维码,关注牛客网
下载牛客APP,随时随地刷题