Print vs Write

Report a typo

There are several ways to write data to a file. Pick the one you find easier and write a list of numbers into the file_with_list.txt.

The list with numbers is defined below. Please write the whole list including brackets and don't add a newline character \n to the end of the file.

Convert the list to a string with str(your_list) and use the file.write() method, it doesn't add a newline character at the end. Alternatively, use print() with the correctly specified end argument.
Write a program in Python 3
numbers = [1234, 5678, 90]
# save this list in `file_with_list.txt`

Create a free account to access the full topic