A+B
https://oj.czos.cn/problem.php?id=1000
a,b=map(int,input().split())
print(a+b)
保留两位小数的三种写法
#方法1:
print("%.2f" % 0.13333)
#方法2
print("{:.2f}".format(0.13333))
#方法3
print(round(0.13333,2))
100以内的质数
num=[];
i=2
for i in range(2,101):
for j in range(2,i):
if(i%j==0):
break
else:
num.append(i)
print(num)
a=int(input())
c=0
for i in range(2,a+1):
for j in range(2,i):
if(i%j==0):break
else:
print(i,end=' ')
c=c+1
if(c%5==0):print()
马的遍历
https://www.luogu.com.cn/problem/P1443
```python
n,m,x,y=map(int,input().split())
dx=[-1,1,2,2,1,-1,-2,-2]
dy=[2,2,1,-1,-2,-2,-1,1]
from collections import deque
res=[[-1]*m for _ in range(n)]
res[x-1][y-1]=0
qu=deque([(x-1,y-1)])
while len(qu)>0:
x,y=qu.popleft()
for i in range(8):
nx,ny=x+dx[i],y+dy[i]
if 0<= nx<n and 0<=ny<m and res[nx][ny]==-1:
res[nx][ny]=res[x][y]+1
qu.append((nx,ny))
for i in range(n):
for j in range(m):
print("{:<5}".format(res[i][j]),end="")
print()
as_index的理解
import pandas as pd
df = pd.DataFrame(data={'books':['bk1','bk1','bk1','bk2','bk2','bk3'], 'price': [12,12,12,15,15,17]})
print(df)
print()
print(df.groupby('books', as_index=True).sum())
print()
print(df.groupby('books', as_index=False).sum())
----------------------------------------------------------------------------------------
![在这里插入图片描述](https://img-blog.csdnimg.cn/a648489d91d34df59daba25124028d7c.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAY29kZWlza2luZw==,size_20,color_FFFFFF,t_70,g_se,x_16#pic_center)
----------------------------------------------------------------------------------------------------------------------------------------------------------
![在这里插入图片描述](https://img-blog.csdnimg.cn/1102e644ecb845d9a1ccad135c25bbd2.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAY29kZWlza2luZw==,size_20,color_FFFFFF,t_70,g_se,x_16#pic_center)
![在这里插入图片描述](https://img-blog.csdnimg.cn/e766ab492aa74f018523df353e49b876.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAY29kZWlza2luZw==,size_15,color_FFFFFF,t_70,g_se,x_16)
----------------------------------------------------------------------------------------------------------------------------------------------------------
![在这里插入图片描述](https://img-blog.csdnimg.cn/480b903f3027423489802f1e7a87c941.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAY29kZWlza2luZw==,size_20,color_FFFFFF,t_70,g_se,x_16#pic_center)
![图2](https://img-blog.csdnimg.cn/09599148711d475ca62e31927132ca9a.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAY29kZWlza2luZw==,size_15,color_FFFFFF,t_70,g_se,x_16#pic_center)
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------