Commit 19188dc6 by BellCodeEditor

save project

parent 00a8067c
Showing with 18 additions and 5 deletions
for i in range(1,10): # 行 try:
for j in range(1,i+1): with open(r'C:\Users\pc\Desktop\article.txt','r+',encoding='utf-8') as f:
print(j,'*',i,'=',(i*j),end=" ")# 使用变量i和j,代替乘法算式里面的元素,打印出单个乘法算式 n=f.read()
print() except:
\ No newline at end of file print('article.txt不存在')
else:
sum=0
n=n.split(' ')
print(n)
for i in n:
j=i.split(',')
print(j)
sum+=len(j)
print(sum)
\ No newline at end of file
for i in range(1,10):
for j in range(1,10):
print(j,"*",i,"=",j*i)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment