Homework1 最后一个单词的长度

姓名:陈学香

学号:4201418

In [1]:
f = open("作业一素材.txt",mode="r",encoding="utf-8")
lines = f.readlines()
print(lines)

line = lines[-3]
words = line.split(" ")
print(words)
word = words[-1]
word = word.replace("\n", "")
word = word.replace(".", "")

print(word)
x = len(word)
print(x)
['010\n', '2019年度报告\u2002AnnuAl report\n', 'IX. Non-Recurring Profit or Loss\n', '√ Applicable   Not applicable\n', 'Unit: RMB\n', '2018  2017 \n', 'Item 2019 Note\n', '(Restated) (Restated)\n', 'For details, please refer to \n', 'Investment income from disposal of subsidiaries 848,211,045.94 807,518,533.61 – Note 5(3)(a) of Chapter 12 \n', 'Financial Report.\n', 'Gains on disposals of non-current assets (including \n', 'offsetting amount for the provision of impairment of  31,356,737.19 71,160,937.90 1,075,903,723.03\n', 'assets)\n', 'It mainly represents \n', 'Government grants recognized in profit or loss for  government subsidies \n', 'the current period (excluding government grants  arising from fiscal \n', 'that are closely related to the Company’s business  545,508,216.82 295,443,847.50 230,922,102.34 appropriation, \n', 'operations, in accordance with national uniform  transportation capacity \n', 'standards) subsidies and tax refund, \n', 'etc.\n', 'Net loss/profit arising from business combinations \n', 'involving enterprises under common control from the \n', '-2,123,517.28 -43,047,655.76 3,495,095.51\n', 'beginning of reporting period to the combination \n', 'date\n', 'Gains or losses from changes in fair value of financial \n', 'assets and liabilities held for trading, derivative \n', 'financial assets and liabilities, and investment (losses)/ It mainly attributable to the \n', 'gains arising from the disposal of financial assets and  gains arising from changes \n', '364,072,933.26 -8,398,916.11 14,060,964.04\n', 'liabilities held for trading, derivative financial assets  in fair value of other non-\n', 'and liabilities and other debt investments, excluding  current financial assets.\n', 'hedging activities related to the normal business \n', 'operations of the Company\n', 'Income from external entrusted loans – 416,510.40 5,060,742.88\n', 'Net amount of other non-operating income and \n', '-38,285,034.94 13,515,766.49 24,976,445.24\n', 'expenses\n', 'Less: Income tax effect 159,282,664.33 63,672,015.52 281,823,573.43\n', '    Profit or loss attributable to minority  \n', '716,085.28 620,414.11 1,048,197.18\n', '    shareholders (after tax)\n', 'Non-recurring profit or loss attributable to \n', '1,588,741,631.38 1,072,316,594.40 1,071,547,302.43 –\n', 'shareholders of the parent company\n', 'Provide explanations for classifying non-recurring profit and loss items defined in the Explanatory Announcement No. 1 for Public Company Information \n', 'Disclosures – Non-recurring Profits and Losses, and for classifying non-recurring profit and loss items listed in the Explanatory Announcement No. 1 for \n', 'Public Company Information Disclosures – Non-recurring Profits and Losses as recurring profit and loss items.\n', ' Applicable √ Not applicable\n', 'The Company has not classified non-recurring profit and loss items defined or listed in the Explanatory Announcement No. 1 for Public Company \n', 'Information Disclosures – Non-recurring Profits and Losses in the reporting period.\n', '顺丰控股股份有限公司\n', 'S.F. HOLDING CO., LTD.']
['Information', 'Disclosures', '–', 'Non-recurring', 'Profits', 'and', 'Losses', 'in', 'the', 'reporting', 'period.\n']
period
6
In [ ]: