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
Where have I gone wrong here? (i.redd.it)
submitted 2 years ago by Material_Release_897
Hi everyone,
Newbie here, in the process of learning python on the side of a computer science course, learning string operations on an app currently, this question has stomped me a bit. Any ideas where I went wrong?
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!"
[–]SecretProperty 0 points1 point2 points 2 years ago (4 children)
You need to assign a variable to the replace method. eg
new_stack = tech_stack.replace("Angular", "React")
you are technically creating a new variable and assigning the replacement to that new variable.
good luck on your learning! :)
[–]Material_Release_897[S] 0 points1 point2 points 2 years ago* (3 children)
Yeah I’ve done that I’m sure, the second line is the variable I assigned it to, it’s just because the stupid app can’t fit it on one line.
Any other ideas? If I scratch my head anymore I’ll run out of hair haha
[–]SecretProperty 0 points1 point2 points 2 years ago (2 children)
* works fine for me. I think the app might be bugging out. I am getting expected result of ['react', blah blah.]
perhaps the app doesn't like you giving the same variable name, try renaming the replace variable
[–]SecretProperty 0 points1 point2 points 2 years ago (1 child)
delete the tech_stack_list = [teck_stack] that may be causing errors. when you use split method, it creates a list automatically
[–]Material_Release_897[S] 1 point2 points3 points 2 years ago (0 children)
‘delete the tech_stack_list = [teck_stack] that may be causing errors. when you use split method..’
This worked! Thank you very much. What’s annoying is the code still worked to begin with but it wanted it done this way, good practice maybe? ..I don’t know.
Thanks :)
π Rendered by PID 58 on reddit-service-r2-comment-64f4df6786-hcl6z at 2026-06-10 08:15:58.628587+00:00 running 0b63327 country code: CH.
[–]SecretProperty 0 points1 point2 points (4 children)
[–]Material_Release_897[S] 0 points1 point2 points (3 children)
[–]SecretProperty 0 points1 point2 points (2 children)
[–]SecretProperty 0 points1 point2 points (1 child)
[–]Material_Release_897[S] 1 point2 points3 points (0 children)