import pandas as pd
s1=pd.Series(range(1,12,3))
print(s1)
该程序段运行后输出结果为( )
p = "Call-168"
c = " "
for ch in p:
if ch >= "0" and ch <= "9":
c += str(9-int(ch))
elif ch >= "a" and ch <= "z":
c += chr(ord(ch) - ord("a")+ord("A"))
else:
c += ch
print(c)
程序运行后,输出的结果是( )
import random
a = [34, 12, 93, 8, 14, 18, 24, 17, 51, 57]
num = random.randint(2, 3)
List = []
for i in range(len(a)):
if a[i] % num == 0:
List.append(a[i])
print(List)
执行该程序段后,输出的结果可能是( )
from math import *
def isPrime(x): # 判断是否为素数
i = 2
while :
if x % i == 0:
return ①
i += 1
return True
count = 0
for p in range(2, 50): # 判断否为梅森素数
if ② :
m = ③
if isPrime(m) == True:
print(m)
count += 1
print("2的50次方减1以内的梅森素数共有:" + ④ + "个")
① ② ③ ④
from math import *
def dist(x1, y1, x2, y2):
length = sqrt((int(x1) - int(x2))**2 + ① )
return length
a = input("请输入各点的坐标:") # 如“2,3,4,5”则表示坐标点(2,3)和(4,5)
b = a.split(",")
if len(b) % 2 != 0:
print("输入的坐标有误!")
else:
s = 0
for i in range(0, ② , 2):
s = s + ③
print("折线的长度为:", s)
A.程序输出正确的折线长度
B.输入的坐标有误!
C.程序运行出错!
① ② ③