Diff
checker
文本
文本
图像
文档
Excel
文件夹
Legal
Enterprise
桌面版
定价
登录
下载 Diffchecker 桌面版
比较文本
查找两个文本文件之间的差异
工具
历史
实时编辑器
折叠未更改行
关闭换行
视图
拆分
统一
比对精度
智能
单词
字符
语法高亮
选择语法
忽略
文本转换
转到第一个差异
编辑输入
Diffchecker Desktop
运行Diffchecker最安全的方式。获取Diffchecker桌面应用:您的差异永远不会离开您的电脑!
获取桌面版
Untitled diff
创建于
10年前
差异永不过期
清除
导出
分享
解释
1 删除
行
总计
删除
字符
总计
删除
要继续使用此功能,请升级到
Diff
checker
Pro
查看价格
29 行
全部复制
5 添加
行
总计
添加
字符
总计
添加
要继续使用此功能,请升级到
Diff
checker
Pro
查看价格
29 行
全部复制
the_count = [1, 2, 3, 4, 5]
the_count = [1, 2, 3, 4, 5]
fruits = ['apples', 'oranges', 'pears', 'apricots']
fruits = ['apples', 'oranges', 'pears', 'apricots']
change = [1, 'pennies', 2, 'dimes', 3, 'quarters']
change = [1, 'pennies', 2, 'dimes', 3, 'quarters']
# this first kind of for-loop goes through a list
# this first kind of for-loop goes through a list
for number in the_count:
for number in the_count:
复制
已复制
复制
已复制
print "This is
count %d" % number
print "This is
the_
count %d" % number
# same as above
# same as above
for fruit in fruits:
for fruit in fruits:
print "A fruit of type: %s" % fruit
print "A fruit of type: %s" % fruit
# also we can go through mixed lists too
# also we can go through mixed lists too
复制
已复制
复制
已复制
# notice we have to use %r since we don't know what's in it
# notice we have to use %r since we don't know what's in it
for i in change:
for i in change:
print "I got %r" % i
print "I got %r" % i
# we can also build lists, first start with an empty one
# we can also build lists, first start with an empty one
elements = []
elements = []
# then use the range function to do 0 to 5 counts
# then use the range function to do 0 to 5 counts
复制
已复制
复制
已复制
for i in range(0,
6):
for i in range(0,
6):
print "Adding %d to the list." % i
print "Adding %d to the list." % i
# append is a function that lists understand
# append is a function that lists understand
elements.append(i)
elements.append(i)
# now we can print them out too
# now we can print them out too
复制
已复制
复制
已复制
for i in elements:
for i in elements:
print "Element was: %d" % i
print "Element was: %d" % i
已保存差异
原始文本
打开文件
the_count = [1, 2, 3, 4, 5] fruits = ['apples', 'oranges', 'pears', 'apricots'] change = [1, 'pennies', 2, 'dimes', 3, 'quarters'] # this first kind of for-loop goes through a list for number in the_count: print "This is count %d" % number # same as above for fruit in fruits: print "A fruit of type: %s" % fruit # also we can go through mixed lists too # notice we have to use %r since we don't know what's in it for i in change: print "I got %r" % i # we can also build lists, first start with an empty one elements = [] # then use the range function to do 0 to 5 counts for i in range(0, 6): print "Adding %d to the list." % i # append is a function that lists understand elements.append(i) # now we can print them out too for i in elements: print "Element was: %d" % i
更改后文本
打开文件
the_count = [1, 2, 3, 4, 5] fruits = ['apples', 'oranges', 'pears', 'apricots'] change = [1, 'pennies', 2, 'dimes', 3, 'quarters'] # this first kind of for-loop goes through a list for number in the_count: print "This is the_count %d" % number # same as above for fruit in fruits: print "A fruit of type: %s" % fruit # also we can go through mixed lists too # notice we have to use %r since we don't know what's in it for i in change: print "I got %r" % i # we can also build lists, first start with an empty one elements = [] # then use the range function to do 0 to 5 counts for i in range(0,6): print "Adding %d to the list." % i # append is a function that lists understand elements.append(i) # now we can print them out too for i in elements: print "Element was: %d" % i
查找差异