输入f.write?可以看到write方法的用法及返回值,通过 Returns the number of characters written (which is always equal to the length of the string). 可以从看出write方法的返回值是写入字符串的长度,因此结果是3