
strip
移除字符串头尾指定字符或者字符序列
type
输出变量的数据类型
count
统计指定起点或者终点中, 某个字符或者子串出现的次数
insert
将指定对象插入列表指定位置
sep
自定义分隔符, 常用于 print 函数中进行分割
score = [] avg = [] for i in range(0, 4): score.append([0] * 3) for i in range(0, 4): for j in range(0, 3): score[i][j] = int(input()) avg[i] += score[i][j] for i in range(0, 4): print(avg[i])
year = int(input("Please input a year"))
if year % 4 == 0 and year % 100 != 0 or year % 400 == 0:
print(year,'是闰年')
else:
print(year,'是平年')
def swap(a, b): t = a a = b b = t print(a, b)
for x in range(1, 10):
for y in range(0, 10):
for z in range(0, 10):
s1 = x * 100 + y * 10 + z
s2 = x**3 + y**3 + z**3
if s1 == s2:
print(s1)
file = open('C:/a.txt','w+')
a = "123456"
file.write(a)
file.close()