Welcome Guest.

1Answers

Write the code, read the content of the file, and turn everything into a lowercase

Asked by: Janet Rogers 17 views IT June 26, 2022

The first letter in the document is the word "P", which is not allowed to repeat.Print results (print a word per line) and write to the file name "***. TXT" file (one word per line).

Addition: Python

1 Answers

  1. +3Votes  

    What is the file name input?The following is a reference for the input of the console (considering only the comma and spaces as the word separation, the specific requirements are not converted into a lowercase)

    Question: Give the “***. Txt” file, write code, read the content of the file, convert all content into a lower case, and mention
    The first letter in the file is the word “P”, which is not allowed to repeat.Print results (print a word per line) and write
    To the file name “***. Txt” file (one word per line).

    Answer: So
    a = init ()
    Change to
    f = Open (“***. TXT”, “R”) #Open the file
    a = str (f.read ()) #Read the content
    ***. Close () #Close file
    a = ***. LOWER () #into a lowercase
    Of course, if there is a change in the file, you have to turn it into a space
    In addition, my output is sorted well
    This is just for your reference. You need to understand and modify it as required.

    Ruby Turner- June 27, 2022 |