Ask coding questions

← Back to all posts
How would I do this?
MaciahLawson (1)

ok, so I have posted before about something small...
But this is "big" (to me)... and I don't really understand how to do this. Can someone help?

from Post import Post

all_posts_archive = []

your code here

username = input("What's your username?")
print("What would you like to do?")
print("add - Add a post to the archive")
print("remove - Remove a post from the archive")
print("change user - Change the user name associated with any future posts")
print("print - Display the current up to date list of all posts")
print("quit - End the program")
user_input = input("Your response: ")

This while loop ensures that the program will continue executing

statements at the next indentation level until the user types "quit"

in response to the prompt.

while (user_input != "quit"):

if/elif/else statements to check the user's decision

if (user_input == "add" ):
message = input("What's your message?")
post = post(username, message)

figglediggle (136)

If you want to share code, add a repl to the post. We'll be able to help you more from there.

Baconman321 (1060)

What are you asking for, exactly?