本文共 291 字,大约阅读时间需要 1 分钟。
题目:The textfile, travel_plans.txt, contains the summer travel plans for someone with some commentary. Find the total number of characters in the file and save to the variable num.
travel_plans = open('travel_plans.txt','r')chars = travel_plans.read() #read获取文件的每个字符num = len(chars)print(num)
转载地址:http://hnrci.baihongyu.com/