1.
def max2(x):
# write your code here...
ls_x=list(x)
m1 = max(ls_x)
ls_x.remove(max(ls_x))
m2 = max(ls_x)
return (m2,m1)
ls = eval(input())
print(max2(ls))
2.import math
r=float(input())
r=float(r)
S=math.pi*r**2
print('{:.2f}'.format(S))
3.def midnum(ls):
ls.sort()
s=len(ls)
if s%2==0:
i=(s-1)//2
mid=(ls[i]+ls[i+1])/2
else:
i=s//2
mid=ls[i]
return mid
ls=list(eval(input()))
print(midnum(ls))
4.
def countlevels():
#write your code here...
x=7
while True:
x=x+7
if x%2==1 and x%3==2 and x%5==4 and x%6==5:
break
return x
print(countlevels())
5.
import math
a, b = eval(input())
# 请在此添加代码,要求判断是否存在两个整数,它们的和为a,积为b
def judge(a,b):
for i in range(max(a,b)):
for j in range(max(a,b)):
if i+j==a and i*j==b:
return "Yes"
return"No"
print(judge(a,b))
6.
from math import sqrt
class Point:
def __init__(self, x=0, y=0):
##### write your codes here...
self.x=x
self.y=y
def is_first_quadrant(self):
##### write your codes here...
if self.x>=0 and self.y>=0:
return True
else :
return False
def __str__(self):
##### write your codes here...
return f'({self.x},{self.y})'
def distance(self, other):
##### write your codes here...
return ((self.x-other.x)**2+(self.y-other.y)**2)**(1/2)
p1 = Point(0, 0)
p2 = p2 = Point(3,4)
print(p2) ##输出(3,4)
print(p2.is_first_quadrant()) ##输出True
print(p1.distance(p2)) ##输出5.0