r/PythonLearning • • Oct 11 '26

Help Request Trouble with printing

Post image

I’ve been having trouble with an assignment I’m doing and I’m not sure where I went wrong. The only error i’m getting is “‘str’ object is not callable” and i’m not sure if anything else here is wrong.

Edit: After messing around with the code a bit, turns out my code wasn’t the problem and my previous files weren’t printing. After restarting vscode, everything was fine again. Thank you everyone!

45 Upvotes

49 comments sorted by

41

u/RNG_HatesMe Oct 11 '26 • Bravo

First rule NEVER post code as a picture! How do you expect someone to test it out? Retype everything, really? And half the time, if you have a typo or minor syntax error then a more experienced programmer will intuitively fix it without realizing it.

Repost as actual code. There's even "code" and "code block" syntax type on reddit to get it to line up:

a = 'hello world'
print(a)

-22

u/broccolee Oct 11 '26 • Bravo

Yeah its not like you could paste the screen to some Ai and have it spit out the text

13

u/RNG_HatesMe Oct 11 '26

Ahh, yeah, that's the solution. Instead of the poster copying and pasting the program text into reddit AS IT IS ORIGINALLY, they should instead screenshot it, paste it into a post, where other redditors can then copy the image, paste it into chatGPT (wasting how much energy and water?) to have it turned back into text and HOPE that it did it accurately?

1

u/Im_the_mafia_ Oct 11 '26

I screenshotted the code because it was originally on a computer that I couldn’t access reddit on, so I had to send the photo to my phone.

3

u/FreeLogicGate Oct 11 '26

So you cut and paste the code into the same email that you instead pasted your screenshot (code is text) and then use the code in your reddit code block on the machine you posted from, instead of being lazy and annoying the people you are hoping could help you.

-5

u/Im_the_mafia_ Oct 11 '26

yeah, it was so annoying that six people answered with no issue. Go wash between your necks

3

u/FreeLogicGate Oct 11 '26

You can be lazy and stupid and some people will still try and help you. The irony is that you already updated that you had some sort of "environment" issue (probably pebkac), and that this entire thread was a waste of time for all involved. So the only thing that could possibly be of value now, would be to help you understand the error in your approach, so that you avoid it in the future, and yet here you are doubling down and making excuses that reflect you're stubborn and allergic to learning.

-4

u/Im_the_mafia_ Oct 11 '26

I’m actually just allergic to cunts. If you think i’m annoyed cuz I was told to not ask for help with a screenshot, I can tell Harvard is just knocking your door down.

1

u/csabinho Oct 12 '26

You're allergic to cunts? Brace yourself for an autoimmune disease.

1

u/Im_the_mafia_ Oct 12 '26

Brace yourself for the sex offender registry, because the only way a woman will let you in her is if you force yourself.

→ More replies (0)

3

u/FreeLogicGate Oct 11 '26

Good programmers tend to have an ability to think logically. Purely as an example of a logical expression of your thought processes:

If you think i’m annoyed cuz I was told to not ask for help with a screenshot, I can tell Harvard is just knocking your door down.

That is really something. Check for brain eating worms while you struggle with your intro to python assignments.

2

u/RNG_HatesMe Oct 12 '26

The computer didn't have Internet access?

Look, you are asking for help from a community. It is a minimum level of respect and gratitude to ask for that help in a way that is easiest for that community to help you. If it's not worth your time to do that, then it's not worth the community's time to help you.

1

u/[deleted] Oct 12 '26

[removed] — view removed comment

2

u/RNG_HatesMe Oct 12 '26

So you posted a picture of code asking about an error that isn't even contained *in* the code, and you're the one complaining?

Reddit's not that serious? Ok, I'll give you some not so serious advice:

Your attempt at programming in python so far is lazy and weak in the most basic code there is. You're using multiple steps where fewer steps would be clearer and simpler. You've lost track of what you are doing in step 3 by throwing everything out that you did in step 1 and step 2. You don't seem to understand what actually affects your code because you didn't even include the problem portion when asking about it.

I would *never* normally tell a beginner programmer that directly because I generally want to encourage them to improve. But I don't think you really want to, and I don't expect you'll stick to it. People who want to learn and improve don't normally insult the people who can help them.

-1

u/Im_the_mafia_ Oct 12 '26

your attempt at programming in python so fair is la😴😴😴 you’re using multiple steps😴😴😴😴😴

2

u/RNG_HatesMe Oct 12 '26

Jesus f'in Christ dude that's NOT what I said. In fact, I often argue the opposite. The goal is not to have the fewest number of lines, your code should be efficient and easy to read and understand. If that means that it is a bit longer, that's fine!

I teach applied python programming to ~75 students twice a year. If you are posting for help here, why are you acting like *you* are the expert? Do better. Be better.

-1

u/Im_the_mafia_ Oct 12 '26

i teach applied python 😴😴😴😴😴

2

u/PythonLearning-ModTeam Oct 12 '26

Keep it respectfull

3

u/adavadas Oct 11 '26

And then you type it out for those who you are asking for help

-7

u/broccolee Oct 11 '26

Generally, I fully agree with the commenter, and that it is utterly lazy and respecless to this community to screenshot a code, but at the same it its not hard to solve it. I guess community will respond in kind to those being lazy, so would sort it self out.

1

u/FreeLogicGate Oct 11 '26

There are 2 groups of people participating in subs like this one:

  • Those who are already proficient developers and help others by answering questions, help others to learn, debug and refactor their code

  • Those who are less proficient and come here to ask questions and get help

One of those groups seeks help from the other one. That group (those helping) defines norms and best practices and dictates the format that is most likely to help the other group get the help and responses they seek. Screenshots of code is not helpful, nor efficient, nor something anyone does to communicate with others. Even before AI people could utilize OCR tools. It's not the point, never was the point and never will be the point. If you want others to help, you play by the rules of the community and the profession at large.

-10

u/broccolee Oct 11 '26

This is October 2026, not 2023. Get updated with the ongoing progress.

7

u/RNG_HatesMe Oct 11 '26

Good God man, it actually takes LESS work to do it the right way? Do you rely on AI to add 1+1 for you as well?

0

u/broccolee Oct 11 '26

Hahaha, no. I just ask on reddit for guys like you to provide me with an answer

4

u/RNG_HatesMe Oct 11 '26 edited Oct 11 '26

Ahh, then I can state definitively that 1+1 =4. You should stake all of your retirement on it.

4

u/thondat Oct 11 '26

so people being unable to use reddit's code blocks and requiring readers to use character recognition is progress now?

12

u/External-Audience716 Oct 11 '26

Well one thing, in step 3 you're using gibberish instead of step 2. That's not your problem but something ive noticed

4

u/Rscc10 Oct 11 '26

Aside from using gibberish in step3, I don't see an issue and even so, there's shouldn't be an error even if you're using gibberish instead of step2 there. Can you send the exact error message as well as what gibberish is

3

u/Achereto Oct 11 '26

shouldn't it be step3 = step2.lower()?

2

u/AmanBabuHemant Oct 11 '26

can you share the trackback ?
or complete source code ?

2

u/Taco-Jedi Oct 11 '26

The problem is most likely caused by an earlier attribution of a variable you called "print". If, somewhere in your code, you have something like "print = 'name' ", it will throw an error. To fix that, just rename that variable to something else. I also noticed another thing in your code that might be wrong: in step3, instead of doing "step3 = step2.lower()", you wrote "step3 = gibberish.lower()", therefore your first 2 steps become absolutely useless

1

u/fllthdcrb Oct 13 '26

To fix that, just rename that variable to something else.

To be exact, one would need to assign it to a different name, and then del print. The original assignment shadows the built-in value. The del statement removes the binding in the current environment, while leaving the built-in intact and once again accessible.

1

u/VirulentParable Oct 11 '26

Most coding courses teach you to always do print in this format:

print(f”stuff goes here”)

1

u/AlexMTBDude Oct 11 '26

> The only error i’m getting is “‘str’ object is not callable” 

Sure, but on which line of your code are you getting this error? That's a vital piece of information if you want to find the bug.

1

u/riilcoconut Oct 12 '26

print each step

1

u/XNo_Notes Oct 12 '26

You can do ctl+p and start typing python then look for clear cache and refresh window to restart python without having to close it all down.

1

u/fllthdcrb Oct 13 '26

BTW, I think maybe you could combine steps 4 and 5 by just directly replacing underscores with spaces. Unless, of course, getting experience with split() and join() is part of the assignment, which is not a bad thing.

0

u/Hercules__Morse Oct 12 '26

Maybe delete this post if you have solved the issue yourself? This post will not help anyone else in the future...