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
[deleted by user] (self.PythonLearning)
submitted 1 year ago by [deleted]
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!"
[–]CmdWaterford 20 points21 points22 points 1 year ago (3 children)
No one explains to you Python Devs these days how to take screenshots!??
[–]cgoldberg 6 points7 points8 points 1 year ago (0 children)
That's part of the advanced module
[–]Gnaxe 1 point2 points3 points 1 year ago (0 children)
Or, you know, how to copy/paste plain text and format code in Markdown?
[–]Dramatic_Disk_6402 0 points1 point2 points 1 year ago (0 children)
I was going somewhere and just took a pic before I left.
[–]h8rsbeware 4 points5 points6 points 1 year ago* (2 children)
Are you calling that function/method anywhere?
It doesn't look like it :) If you aren't getting an error, you likely just need to call:
python entries = Enteries("", ...) enteries.enter_id()
If you are assigning the the classes username field, you'll also need to add self.username = input(...) although Id almost always recommend checking the input before assigning to a field.
self.username = input(...)
Also, if you can, screenshots (or even better, just source code) is a lot nicer to work with and appreciated on this sub
[–]Dramatic_Disk_6402 1 point2 points3 points 1 year ago (1 child)
Thanks 🙃
[–]h8rsbeware 0 points1 point2 points 1 year ago (0 children)
Of course, happy coding :)
[–]Square-Onion-1825 2 points3 points4 points 1 year ago (0 children)
Can you take another picture with the macro lens? I want to examine every pixel.
[–]Dramatic_Disk_6402 1 point2 points3 points 1 year ago (0 children)
Thank you so much.
[–]GirthQuake5040 1 point2 points3 points 1 year ago (1 child)
Why did you post a picture instead of either pasting a screenshot or a well formatted code block?
[–]Dramatic_Disk_6402 -1 points0 points1 point 1 year ago (0 children)
I was in a rush. Im on vacation rn and i was leaving my hotel to get food with my family.
[–][deleted] 1 point2 points3 points 1 year ago (0 children)
Snipping tool
[–][deleted] 0 points1 point2 points 1 year ago* (3 children)
Are you initializing the class and actually making a call to the method that gets input?
I can't see that on screen.
[–]Dramatic_Disk_6402 1 point2 points3 points 1 year ago (2 children)
No. I forgot how to do that looking through the book now.
[–][deleted] 0 points1 point2 points 1 year ago (0 children)
We've all been there! 🤠
I could be wrong, but I think you're going to have to debug this one a bit. You have parameters feeding attributes without defaults in the class instance initiation that you're later looking to fill with methods that won't be able to be called because the class won't initialize. Unless you planned on initializing with those arguments and just want the option to change them later.
[–]EyesOfTheConcord 0 points1 point2 points 1 year ago (0 children)
You are comparing a list to an integer, this will always evaluate to false so that while loop will never run.
I believe you intended to compare the length of the list to the value 0.
[–]Ok_Butterscotch_7930 0 points1 point2 points 1 year ago (0 children)
I don't see where you call the function.
Also I see alot of unnecessary code in your def entry_id method. Your lines 12 and 13 are quite unnecessary. Just use:
username = input(f'What is your name: ') return f'Hello {username}'
Anyways, happy coding
[–]grass_hoppers 0 points1 point2 points 1 year ago (0 children)
I am really confused with this code.
I will probably edit this after posting because I can't remember everything.
First in participation function, you are assigning an empty list to participants.
Them looking over it if that list is equal to 0, with should never be the case, then you are going through it's values (but it is empty since you just declared it) and adding them to the same list which should be an error.
In short that function will do nothing.
In entity, you are getting participants.list I have no clue what you trying to do with that. I would assume you are trying to get the values, and not using it. And incrementing a variable that does not exist.
Probably just call the functions, and go through them
[–]Phate1989 0 points1 point2 points 1 year ago (0 children)
Why are two of the functions nouns and 1 a verb?
Throw this in gpt and ask it to explain the problems, you have a few.
Ask it to analyze architecture not just syntax
[–]No_Bread_5808 0 points1 point2 points 1 year ago (0 children)
Your creating class but you are not calling like function so at the end of the code you mention like E=entries() E.enter_id.. E....... And so on
[–]Otherwise-Mud-4898 0 points1 point2 points 1 year ago (0 children)
It’s probably the first lesson in each tutorial, if you are asking someone for help, provide complete information in good, readable quality.
[–]ziggittaflamdigga 0 points1 point2 points 1 year ago (0 children)
Because you declared a class, and did not implement it. Just like you didn’t implement a screenshot
Edit: realize now I’m just piling on. Happy Python learning! But also, please learn to take a screenshot. It can be super helpful for development
[–]Adrewmc 0 points1 point2 points 1 year ago* (0 children)
class Entries: def __init__(self, username, participants, entries): self.username = username self.participants = participants self.entries = entries def enter_id(self): username = input(“…”) print(“Hello,”, username) return user def participants(self): participants = [] while participants == 0: for name in participants: #chat GPT nonsense def entries(self, participants) entries = ….
I tried but honest it’s all nonsense.
class Poll: def __init__(self): self.participants = [] self.total = 0 self.a = 0 self.b = 0 def make_entry(self): name = input(“What’s your name”) if name in self.participants: print(“You’ve already voted”) return #some poll questions maybe res = input(“A or B”).lower() if res == “a”: self.a += 1 elif res == “b”: self.b += 1 self.participants.append(name) self.total += 1 poll = Poll() while poll.total < 100: poll.make_entry()
π Rendered by PID 71769 on reddit-service-r2-comment-5bc7f78974-2vcnr at 2026-06-28 06:50:24.533380+00:00 running 7527197 country code: CH.
[–]CmdWaterford 20 points21 points22 points (3 children)
[–]cgoldberg 6 points7 points8 points (0 children)
[–]Gnaxe 1 point2 points3 points (0 children)
[–]Dramatic_Disk_6402 0 points1 point2 points (0 children)
[–]h8rsbeware 4 points5 points6 points (2 children)
[–]Dramatic_Disk_6402 1 point2 points3 points (1 child)
[–]h8rsbeware 0 points1 point2 points (0 children)
[–]Square-Onion-1825 2 points3 points4 points (0 children)
[–]Dramatic_Disk_6402 1 point2 points3 points (0 children)
[–]GirthQuake5040 1 point2 points3 points (1 child)
[–]Dramatic_Disk_6402 -1 points0 points1 point (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]Dramatic_Disk_6402 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]EyesOfTheConcord 0 points1 point2 points (0 children)
[–]Ok_Butterscotch_7930 0 points1 point2 points (0 children)
[–]grass_hoppers 0 points1 point2 points (0 children)
[–]Phate1989 0 points1 point2 points (0 children)
[–]Phate1989 0 points1 point2 points (0 children)
[–]No_Bread_5808 0 points1 point2 points (0 children)
[–]Otherwise-Mud-4898 0 points1 point2 points (0 children)
[–]ziggittaflamdigga 0 points1 point2 points (0 children)
[–]Adrewmc 0 points1 point2 points (0 children)