s = ['12','22','23','31','123','224']
res =s[0]
for i in range(1,len(s)):
if s[i] >= res:
res =s[i]
print(res)
执行上述程序后,输出的结果是( )
s,n=0,8
while True:
s+=n
if s>14:
break
n-=2
print(n,s)
执行程序后,输出结果可能是( )
n = int(input())
a,b,num = 2,1,2
for i in range(n-1):
print(num)
方框中的代码由以下三部分组成:①num += a / b ②a = a + b ③b = a - b代码顺序正确的选项是( )
程序代码如下:
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
img=np.array(Image.open("chenchen.jpg").convert("L"))
rows,cols=img.shape
for i in range(rows):
for j in range(cols):
if():
img[i,j]=1
else:
img[i,j]=0
plt.imshow(img,cmap="gray")
plt.show()
下列说法正确的是( )
a=[21,3,4,5,9,14,23]
c,m=0,0
for i in range(2,len(a)):
if a[i-2]+a[i-1]==a[i]:
c+=1
if c>m:
m=c
else:
c=0
print(m)
执行程序后,输出结果是( )
Ⅰ.设定小写字母a—z对应的数字为1—26,大写字母A—Z对应的数字为27—52。
Ⅱ.将某个单词的所有字母按照其对应的数字求和,
Ⅲ.若和为素数(质数)则判断为素单词,否则不是。
如单词“Hello”,字母分别对应的数字为:34、5、12、12、15,其和为34+5+12+12+15=78,不是素数,因此单词“Hello”不是素单词。
图 a | 图 b |
请回答下列问题: