下面程序的输出结果是______s = 'abc' try: for i in range(3): s[i] = 'a' print(s) except: print('Error')[/i]
Error
举一反三
- 16、下面程序的执行结果是______________。(1275) s = 0 for i in range(1,101): s += i if i == 50: print(s) break else: print(1)
- 阅读程序,输出结果: s=0 for i in range(1,101): s = s + i print('1+2+3+…+100 = ', s)
- s = {1,2,3}[br][/br] for i in s: print(i,end='') print() 以上程序输出结果为( )
- 下列程序输出结果是( )。 i=1 s=0 while i<=3: s=s+i i=i+1 print(s) A: 1 B: 3 C: 6 D: 9
- 有如下程序段:s = 0For i = 1 To 10 s = s + iNext iPrint s与上述程序段输出结果相同的程序段为( )。 A: s = 0: i = 0 While i <= 10 i = i + 1 s = s + i Wend Print s B: s = 0: i = 1 While i < 10 i = i + 1 s = s + i Wend Print s C: s = 0: i = 1 Do s = s + i i = i + 1 Loop While i < 10 Print s D: s = 0: i = 1 Do s = s + i i = i + 1 Loop Until i > 10 Print s
内容
- 0
下列程序输出结果是______。 i=3 s=0 while i<10: i=i+1 if i%3: continue s=s+i print(s) A: 52 B: 49 C: 15 D: 0
- 1
下列程序输出结果是什么?S, T = {1,2,3}, {3,4,5}for i in range(2): S |= T T &= Sprint(str(S)+str(T))
- 2
以下程序的输出结果是____。[br][/br]for s in "abc":[br][/br]for i in range____: print ____ if s=="c":[br][/br]break
- 3
10640.以下程序的输出结果是______。 s = 10 def run(n): global s for i in range(n): s += i return s print(s,run(5)) A: 1020 B: 2020 C: 1010 D: UnboundLocalError
- 4
输入一个字符串s,反向输出它,例如输入"abc",输出"bca" s=input()[br][/br] __________ while i>=0: print(s[i],end="") i = i - 1 print()[/i] A: i=len(s) B: i=len(s)-1 C: i=len(s)+1 D: 都不对