Opening and appending to file in Python3

Joined
Mar 29, 2023
Messages
13
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

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top