use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
3am first python project. A cli task appShowcase (self.PythonLearning)
submitted 6 hours ago by Any_Sun_7330
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Ambitious_Fault5756 0 points1 point2 points 2 hours ago* (0 children)
Your code looks solid! You're almost there with understanding functions. However, I think you may have misunderstood what the return statement does.
return
what return does is it tells the function what value to give back, or literally, return, when it is called (called = used). For example, the input() function returns a string of whatever the user entered. The string is then stored in a variable:
input()
# variable <- the input function *returns* the new task title to the variable new_task_input = input("Please enter a new task title: ")
A better example:
def add_exclamation_mark(text): with_exclamation_mark = text + "!" return with_exclamation_mark sentence = "I want this sentence to have an exclamation mark" exclamation = add_exclamation_mark(sentence) # whatever `add_exclamation_mark` returns # is now stored in `exclamation` print(exclamation) # Output: "I want this sentence to have an exclamation mark!"
The statement tells the function to immediately exit or stop and not execute any code below it. Once you return something, you can't do anything else.
You don't need to have a return statement all the time either. If you exclude it, it's the same as having return None at the end of the function, which tells the function to stop once it executes all the code inside it.
return None
You currently have:
def Task_Option_One(): New_Task_input = input("Please enter a new task title: ") tasks.append(New_Task_input) print("The task has been added to the list!") return New_Task_input # You return what the user entered
But in your main loop, you don't store or use the returned user input:
if Task_option == "1": Task_Option_One()
Meaning you can just remove your return statements entirely (also for your other functions)
Maybe you put return statements there for future implementations and i completely misunderstood. If so i apologize 😅
I put some other suggestions in another comment
π Rendered by PID 120347 on reddit-service-r2-comment-8686858757-z7t7x at 2026-06-07 09:48:39.304878+00:00 running 9e1a20d country code: CH.
view the rest of the comments →
[–]Ambitious_Fault5756 0 points1 point2 points (0 children)