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()