Opening and appending to file in Python3

Joined
Mar 29, 2023
Messages
10
Reaction score
1
I am really enjoying myself learning Python3. But now i seem to have hit a brick wall and cannot find a way around it.
I have been practicing the little i know of python3 with a simple little script called "practice.py" as follows:

Code:
#!/usr/bin/env python3
#
practice = ["Billy", "John", "Peter", "Simon", "Kevin"]
print(*practice, sep='\n')

Which returned the following:

Billy
John
Peter
Simon
Kevin

Flushed with success i decided to add another name to the list using:

Code:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top