摘要:
def factorial(list1,n): if len(list1) > 1: num = int(len(list1) / 2) if list1[num] == n: print('找到数字%s了'%list1[num]) elif list1[num] < n: print('要找的数字 阅读全文
摘要:
import jsonimport osimport re# 数据结构:goods = [ {"name": "电脑", "price": 1999}, {"name": "鼠标", "price": 10}, {"name": "游艇", "price": 20}, {"name": "美女", 阅读全文
摘要:
# 练习题1 —— 全局替换程序:# 写一个脚本,允许用户按以下方式执行时,即可以对指定文件内容进行全局替换# `python your_script.py old_str new_str filename`# 替换完毕后打印替换了多少处内容import sys# print('参数个数:', le 阅读全文