s=input()
n=len(s);c=1;max=1
for i in range(1,n):
if (1)____:
c=c+1
if c>max:
max=c
else:
划线处可选代码为①c=1 ②c=0 ③s[i]<s[i+1] ④s[i]>s[i-1]
划线处正确的语句依次为( )
图a
为分析该年部分气温情况,编写 Python程序,请回答下列问题:
图b
实现该功能的程序如下,请在划线①处填入合适的代码。
划线②处应选填入的代码为(单选,填字母)。
A .df1 B .df1.values C .df1.index
import pandas as pd
df=pd.read_excel(" ① ")
df["日均温"]=(df["最高气温℃"]+df["最低气温℃"])/2
df1=df.sort_values("日均温",ascending=False).日均温.head(1)
Max= ②
date=[ ]
for i in range(len(df)):
if df.at[i,"日均温"]==Max:
date.append(df.at[i,"日期"])
print("日均温最高值:"Max,"℃")
print("日期:",date)
图c
df["月份"]=""
for j in range(len(df)):
df.at[j,"月份"]=df.at[j,"日期"][5:7]
df2=df.groupby("月份",as_index=True).③
plt.plot(④,df2["日均温"],label="月均温" )
plt.xlabel("月份")
plt.ylabel("温度℃")
plt.legend()
plt.show()
s=input()
t=0
mw=''
for i in range(len(s)):
ch=s[i]
if '0'<=ch<='9':
t=t*10+int(ch)
elif ch=='-':
mw+=chr(t%26+ord('A'))
t=0
else:
mw+=ch
print(mw)
执行该程序段输入“29-052-24!”(不包括双引号),则输出的结果是( )
下列关于该计算机的说法,正确的是( )
请回答下列问题:
图 a
序号 | 路由 | 功能 |
1 | / | 访问系统首页 |
2 | /readhreadt | 查看历史温湿度数据 |
3 | / | 查看实时温湿度数据 |
图 b | 图 c |
import pandas as pd
import matplotlib.pyplot as plt
df=pd.read_excel("data.xlsx") #读取文件 data.xlsx 中的数据
for i in range(len(df)) :
if i%2==0 and df.at[i,"监测值"]>30:
df.at[i,"状态"]=1
if i%2==1 and df.at[i,"监测值"]<50:
df.at[i,"状态"]=1
dfg=df.groupby("时间" , as_index=False).状态.sum()
time=[] ; data=[]
for t in range (24):
s=str(t); c=0
if t<10:
s='0'+s
time.append(s)
dft= dfg[]
for j in dft.index:
if dft.at[j,"时间"][:2]==s:
data.append(c)
plt.plot(time, data)
#设置绘图参数,显示如图 c 所示线形图,代码略
m = int(input("请输入内存容量:"))
s = input("请输入英语句子:")
dic = {}
head = tail = 0
word = ""
for ch in s:
if ch == " " or ch == "," or ch == ".":
if word not in dic or dic[word] < head:
if tail - head == m:
dic[word] = tail
tail + = 1
word = ""
else:
if :
ch = chr(ord(ch) + 32)
word += ch
print("需要去外存查找",,"次词典")