运行代码,输出结果为()。
#!/usr/bin/envpython3
N=100
Sum=0
Counter=1
Whilecounter<=n:
Sum+counter
Counter+=1
Print("1到%d之和为:%d"%(
N,sum))
#!/usr/bin/envpython3
N=100
Sum=0
Counter=1
Whilecounter<=n:
Sum+counter
Counter+=1
Print("1到%d之和为:%d"%(
N,sum))
A1到100之和为:5000
B1到100之和为:0
C1到100之和为:2050
D1到100之和为:5020
相关试题
-
运行代码,输出结果为()。#!/usr/bin/envpython3N=100Sum=0Counter=1Whilecounter<=n:Sum+counterCounter+=1Print(1
-
运行代码,输出结果为()。#!/usr/bin/env python3N=100Sum=0Counter=1While counter <n:Sum+counterCounter +=1Prin
-
n代码运行结果为(____)。$;$def Sum(a, b=3, c=5):$;$ return sum([a, b, c])$;$print(Sum(a=8, c=2))$;$print(
-
写出下面代码的运行结果 ( )。 def Sum(a, b=3, c=5): print(a,b,c) Sum(a=8, c=2)
-
阅读下列代码,判断运行结果是( ) Declare @sum int,@count int Select @sum=0,@count=1 Label1: Select @sum=@sum+@coun