
a=4
s=0
while a>=0:
s=s+a
a=a-1
print(s,a)
|
year=2021 if (year%400==0) or ( year%4==0 and year%100!=0 ): days=366 else: days=365 print(days) ⑴程序运行结果是:。 |
a=88 b=48 c=a//b If c==0: c=a*10+b . elif 1<=c<=9: c=a*100+b elif 10<=c<=99: c=a*1000+b print(c) ⑵程序运行结果是:。 |
|
for i in range(1,10,2): print(iend=" ") ⑶程序段执行结果是:。 |
for i in range(1,100): if i%3==0 and i%7==0: print(iend=" ") ⑷程序段执行的结果是:。 |
i=1
sum=0
while i<=20:
if I %2==0:
sum=sum-i
else:
sum=sum+i
i +=1
print (sum)
|
对象名 |
属性名 |
属性 |
|
Command1 |
计算 |
Private Sub Command1_Click()
Dim i, s As Integer
s =
For i = 0 To 100 Step 1
Next i
Label2.Caption = Str(s)
End Sub
Dim i As Integer, s As Integer
s=4
i=9
If i < 1 Then
i=i-3
Else
i=s+i
End If
s=1
For i=1 to 3
s=s*i
Next i
from microbit import *
while True:
water_ level =pinl. read_ analog () #将p1引脚的模拟值设为变量“water_ level”
if water_ level<300:
display. show (Image. SAD)
else:
display. show (Image. HAPPY)
If a<=70 Then i=1
If a>70 Then i=2
Print i
以上程序段的执行结果为2。
m=19
if m>=30 or m<20:
print(m)
a=int(input())
if :
print("7的倍数" )
else:
print("不是7的倍数")
a=0
for i in range(1,4):
a=a+i
print(a)
a=32
b=14
c=a%b
print(c)
a=4
b=6
avg=(a+b)/3
print(avg)

a2=int(input ("请输入自然数:"))
p=int(a1/a2+a1*a2) print(p)
假如输入15和5,结果是( )