代码全是用的python 3.x语法
x = int(input())
y = int(input())
print(x+y)
x = input().split()
print(int(x[1])**2 - 4*int(x[0])*int(x[2]))
s = "Python语言简单易学"
print(s.encode("utf-8"))
x = int(input())
y = 0
for i in range(11, x+1):
y += i
print("sum =",y)
a = float(input())
print("f({:.1f}) = {:.1f}".format(a, 1/a) if a != 0 else "f({:.1f}) = {:.1f}".format(a, a))
a = int(input())
ans = 0
if a <= 50:
ans = a*0.53
else:
ans = 50*0.53 + (a -50)*0.58
print("cost = {:.2f}".format(ans) if a > 0 else "Invalid Value!")
a, b = input().split()
ans = 0
for i in range(1, int(b)+1):
ans += int(a*i)
# print(a*i)
print("s = %s"%ans)
n = int(input())
s = 0.0
index = 1
for i in range(0, n):
s += 1.0/index
index += 2
print("sum = {:.6f}".format(s))
n = int(input())
index = 1
s = 0.0
for i in range(1, n+1):
if i % 2 == 0:
s -= i/index
else:
s += i/index
index += 2
print("{:.3f}".format(s))
a, b = input().split(",")
print(a.strip()*int(b))
a, b = input().split(",")
print(int(a, int(b)))
lst = list(map(lambda x: int(x), input().split()))
lst.sort()
print("{}->{}->{}".format(lst[0], lst[1], lst[2]))
a, b = input().split()
if int(a) > int(b):
print("Invalid.")
else:
print("fahr celsius")
for i in range(int(a), int(b)+1, 2):
print("{}{:6.1f}".format(i, 5*(i-32)/9))
a, b = input().split()
s = 0.0
for i in range(int(a), int(b)+1):
s += i*i + 1/i
print("sum = {:.6f}".format(s))
from math import sqrt
a, b, c = map(lambda x: float(x), input().split())
if a + b <= c or a + c <= b or b + c <= a:
print("These sides do not correspond to a valid triangle")
else:
p = (a+b+c)/2
area = sqrt(p*(p-a)*(p-b)*(p-c))
perimeter = a+b+c
print("area = {:.2f}; perimeter = {:.2f}".format(area, perimeter))
a = float(input())
ans = 0.0
if a <= 15:
ans = a*4/3
else:
ans = 2.5*a - 17.5
print("{:.2f}".format(ans))
a, b = map(lambda x: int(x), input().split())
index = 0
s = 0
for i in range(a, b+1):
print("{:5d}".format(i), end="")
index += 1
s += i
if index % 5 == 0:
print()
if index % 5 != 0:
print()
print("Sum = %s"%s)
lst = list(map(lambda x: int(x), input().split()))
avg = sum(lst)/len(lst)
for x in lst:
if x > avg:
print(x, end=" ")
n = int(input())
dic = {0: '1', 1: '0', 2: 'X', 3: '9', 4: '8', 5: '7', 6: '6', 7: '5', 8: '4', 9: '3', 10: '2'}
weight = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
lst = []
for i in range(n):
b = input()
s = 0
u = 0
for x in b[:-1]:
if not x.isdigit():
u = 1
if u == 1:
lst.append(b)
continue
for x in b[:-1]:
s += (ord(x)-ord('0'))*weight[u]
u += 1
if ord(dic[s % 11]) != ord(b[-1]):
lst.append(b)
if len(lst) == 0:
print("All passed")
else:
for x in lst:
print(x)
s = input()
a, b = input().split()
for i in range(len(s)-1, 0, -1):
if ord(s[i]) == ord(b[0]):
print(i, b)
for i in range(len(s)-1, 0, -1):
if ord(s[i]) == ord(a[0]):
print(i, a)
c = input()
s = input()
index = -1
for i in range(len(s)):
if ord(s[i]) == ord(c[0]):
index = i
print("index = %s" % index if index != -1 else "Not Found")
a = input()
print(int("".join([x for x in a if x.isdigit()])))
from collections import Counter
lst = list(map(lambda x: int(x), input().split()))
ans = Counter(lst[1:]).most_common(1)[0]
print(ans[0], ans[1])
n = int(input())
lst = list(map(lambda x: int(x), input().split()))
index = 0
for x in range(n):
if lst[x] > lst[index]:
index = x
print("%d %d" % (lst[index], index))
a = input()
print(a[::-1])
a = input().split("#")[0].lower()
b = ['a','b','c','d','e','f']
countN = 0
for x in a:
if ord(x) == ord('-'):
countN += 1
if x.isdigit() or x in b:
break
lst = [x for x in a if x.isdigit() or x in b]
if len(lst)==0:
print(0)
else:
print(int("".join(lst), 16) if countN == 0 else -int("".join(lst), 16))
res = sum([1 if ch.isalpha() and ch.isupper() and ch not in set(["A", "O", 'E', 'I', 'U']) else 0 for ch in input()])
print(res)
a = input().split()
a.sort()
print("After sorted:")
for key in a:
print(key)
x = input()
a = len(x)
b = 0
for i in x:
b = b + int(i)
print(a, b)
x = input()
for ch in x:
if ch.isupper():
ch = chr(ord('Z') - ord(ch) + ord('A'))
print(ch, end = "")
x = input()
for ch in x:
if ch.isupper():
ch = ch.lower()
elif ch.islower():
ch = ch.upper()
elif ord(ch)==ord('#'):
break
print(ch, end = "")
print(len(input().split()))
x = set(input())
y = list(x)
y.sort()
print("".join(y))
a = input().strip()
b = input().strip()
print("result: ", end="")
for x in a:
if ord(b[0]) == ord(x) or ord(x.lower()) == ord(b[0]) or ord(x.upper()) == ord(b[0]):
continue
else:
print(x, end="")
a = input()
newa = []
for x in a:
if x not in newa and x.upper() not in newa and x.lower() not in newa:
newa.append(x)
lst =[x for x in newa if x.isalpha()]
print("".join(lst[:10]) if len(lst) >= 10 else "not found")
n = int(input())
ans = ""
for i in range(n):
b = input()
if len(b) > len(ans):
ans = b
print("The longest is: %s"%ans)
a = input()
b = a[::-1]
i = 0
while ord(b[i]) == ord('0'):
i += 1
print(b[i:])
a = input()
b = a[::-1]
print(a)
print("Yes" if a == b else "No")
lst = input()
ans = ""
for x in lst:
if x.isupper() and x not in ans:
ans += x
print(ans if len(ans) > 0 else "Not Found")