In this task, you have to sort the lines of the code given below. Mind that first we need to create a list of animals.
Writing files
Sort the code
Report a typo
Put the items in the correct order
animals = ['cat\n', 'dog\n', 'hamster\n']animal_file = open('animals.txt', 'w', encoding='utf-8')animal_file.close()animal_file.writelines(animals) ___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.