#Python TQC考題909
f_name = “data.dat”
file = open(f_name,”wb”)
# TODO
for i in range(5):
inp = input()
b_inp = bytearray(inp+”\n”,”utf-8″)
file.write(b_inp)
file.close()
print(‘The content of “data.dat”:’)
with open(f_name,”rb”) as file:
for line in file:
print(line.decode(“utf-8”))
“””
The content of “data.dat”:
“””

#只要加encoding=”utf-8″
#b模式都用不到,如: rb, wb




![Python: pandas.DataFrame串接; pandas.concat( [df1,df2] , axis=1, ignore_index=True) ; .append() 產生一個新的DataFrame; 插入欄 .insert() 改變原DataFrame Python: pandas.DataFrame串接; pandas.concat( [df1,df2] , axis=1, ignore_index=True) ; .append() 產生一個新的DataFrame; 插入欄 .insert() 改變原DataFrame](https://i0.wp.com/savingking.com.tw/wp-content/uploads/2022/11/20221129145451_29.png?quality=90&zoom=2&ssl=1&resize=350%2C233)






近期留言