长方形 height = int(input("please you want to height:")) width = int(input("please you want to width:")) num_height = 0 while height > num_height: num_wi Read More
函数的使用 形参,实参 import time # 创建logger函数,等待传入的值为,形参 def logger(date): print("starting action1") with open("log.txt","a") as f: f.write("end save date: %s\ Read More
模式种类 r 打开只读文件,该文件必须存在。 r+ 打开可读写的文件,该文件必须存在。 rb 以二进制读取 w 打开只写文件,若文件存则全部清空,若文件不存在则建立该文件。 w+ 打开可读写文件,若文件存则全部清空,若文件不存在则建立该文件。 wb 以二进制写入 a 附加的方式打开只写文件。若文件不 Read More