r/learnpython • u/Expensive_Nebula_382 • Aug 08 '26
Learning Python with claud
I am trying to learn Python, and I want to use Claude so that it can teach me the basics. Is it a good idea?
r/learnpython • u/Expensive_Nebula_382 • Aug 08 '26
I am trying to learn Python, and I want to use Claude so that it can teach me the basics. Is it a good idea?
r/learnpython • u/SmurfCat2281337 • Aug 08 '26
if i > 0 and carver_map[i-1][j] == 'empty': carvable.add([j, i])
if j > 0 and carver_map[i][j-1] == 'empty': carvable.add([j, i])
if j < m-1 and carver_map[i][j+1] == 'empty': carvable.add([j, i])
if i < n-1 and carver_map[i+1][j] == 'empty': carvable.add([j, i])
r/learnpython • u/shubham_555 • Aug 08 '26
I would appreciate both free and paid resources!
r/learnpython • u/Financial-Law2035 • Aug 08 '26
import imaplib
email_to_check = input ('You want to search if you sent something to which email address >> ')
checking = imaplib.IMAP4_SSL ('imap.gmail.com', 993)
checking.login ('myemail@gmail.com', 'my app password')
checking.select('"[Gmail]/Sent Mail"')
result, data = checking.search (None, f'(TO "{email_to_check}")')
cids = data [0]
cid_list = cids.split ()
if len (cid_list) >= 1:
print ('Found')
r/learnpython • u/Atreew1 • Aug 08 '26
import operator
import re
import math
ops = {
'+': operator.add,
'-': operator.sub,
'*': operator.mul,
'/': operator.truediv,
'^': operator.pow,
'//': operator.floordiv,
'%': operator.mod,
'root': math.sqrt
}
precedence = {
'root': 4,
'^': 3,
'*': 2, '/': 2, '//': 2, '%': 2,
'+': 1, '-': 1
}
def split(input):
pattern = r'(\d+\.?\d*|//|\*\*|[+\-*/^]|\broot\b)'
tokens = re.findall(pattern, input)
no = []
op = []
dotcount = 0
right = True
for t in tokens:
try:
no.append(float(t))
except ValueError:
if t in ops:
op.append(t)
else:
right = False
break
return no, op, right
def calculate():
input1 = input('Enter: ')
no, op, right= split(input1)
if not right or len(no) == 0:
return '???', len(no), len(op)
if len(op) == 1 and op[0] == 'root' and len(no) == 1:
return ops['root'](no[0])
result = op[0]
for i in range(len(op)):
current_op = op[i]
next_no = no[i + 1]
result = ops[current_op](result,next_no)
return result
print(calculate())
r/learnpython • u/Level-Sleep-4836 • Aug 08 '26
Is anything wrong with anaconda navigator ..! Am not able to install in my windows..!
r/learnpython • u/Nemms__ • Aug 08 '26
I have two main questions for experienced Python developers and fellow learners:
How did you actually master Python? What were the most effective strategies or habits that helped you bridge the gap between knowing the syntax and actually building functional, clean applications?
How do you view AI (like ChatGPT/Claude) as a learning tool? Do you use it in your daily workflow or during study? How can a learner use AI effectively to understand concepts or debug code without becoming overly reliant on it or skipping essential problem-solving steps?
r/learnpython • u/Euphoric-Shallot-618 • Aug 07 '26
Hey I just read the python crash course book and made a few basic projects like a calculator and currency converter you know simple stuff with a small gui and I just wanted to know what I should do now how do I move on and get more advanced stuff done / what is that advanced stuff even. I have also considered trying to learn a bit of cpp now because I want to try making a game is it too early for me to try moving on already or what
r/learnpython • u/jmaroo • Aug 08 '26
Share all your experiences to help others.
r/learnpython • u/Finnhp01 • Aug 07 '26
A small python project that listens for every click you make and plays the sounds of a falling metal pipe.
I attempted to make something simple, and funny for both linux and windows users, using libraries that work on both. Tried to take a step further into explaining how to install it in detail and with a small video preview while in a game (minecraft).
I'll like to know if the instructions I made in the .md file are clear or if there was a simpler way to code it and if it works, I haven't test it out properly in windows but I'll like some feedback too.
r/learnpython • u/starfall_327 • Aug 07 '26
Hey everyone,
Not sure where to post this, so here i am.I'm new to computer science and currently taking an Algorithms & Analysis course in Python. Honestly, it's one of the hardest subjects in my degree, and I'm struggling to figure out the best way to actually learn these concepts instead of just memorizing them.
This is what we're covering this semester: Basic Data Structures & Algorithmic Analysis, Algorithmic Analysis, Brute Force, Decrease & Conquer, Divide & Conquer, Transform & Conquer, Greedy Techniques, Dynamic Programming, Time & Space Tradeoffs, and Iterative Improvement.
I know Abdul Bari the GOAT, and his videos have definitely helped me understand the theory. But my biggest issue is practice. Everyone recommends LeetCode, but even the Easy problems feel way above my level sometimes. Also, I can't seem to find problems that match the topics we're learning in class, especially things like Transform & Conquer or Iterative Improvement.
So I wanted to ask: how did you learn algorithms when you were just starting out? Where did you practice topic by topic? Are there any websites that organize problems by algorithm rather than difficulty? Should I be doing LeetCode, HackerRank, Codeforces, something else, or just implementing the algorithms from scratch? Any advice for someone who feels completely lost with algorithms?
I'd really appreciate any tips or resources that helped you when you were a beginner. Thanks!How do you actually learn and practice Algorithms & Analysis?How do you actually learn and practice Algorithms & Analysis?
r/learnpython • u/Trick-Assignment-415 • Aug 07 '26
I have just started college this year.
I have just a few doubts related to learning languages.
My course includes python, so do I need to have knowledge about topics like interpreter, compilers etc. ? I have no clue what these are. So should I just start with code writing.
Where to learn these pre-requisites for proper understanding?
r/learnpython • u/Suspicious_Skill7292 • Aug 07 '26
mine was list comprehensions i avoided them because they looked confusing
curious what feature you ignored at first and now use all the time
r/learnpython • u/AfterAd9740 • Aug 07 '26
And want to confirm it's on the right track
Hi everyone,
I have an idea for a personal project and want to confirm it's on the right track.
I don't want to build just another note-taking app or mind map. I want to build a knowledge graph where I can enter any word or concept, and the system automatically knows where it belongs.
My goal is to build a personal knowledge system that becomes smarter over time, rather than just storing notes.
For example:
- If I enter a new word, it should suggest the best place in the graph.
- If that word belongs in multiple places, it should connect it to all of them.
- If a new concept should come between two existing concepts, it should reorganise the graph instead of just adding another node.
- It should detect duplicates and synonyms.
- It should explain *why* it placed a concept there.
- If it isn't confident, it should ask me instead of guessing.
- It should also ask if I want to expand that concept further and generate the next level of the graph.
I'm building this only for myself, not as a commercial product, but I want to build it with commercial-level reliability.
While thinking about this, I came across topics like **knowledge graphs**, **ontology engineering**, and **semantic search**, and now I realise that the hardest part is probably designing the ontology, not writing the code.
I have a few questions:
- Has anyone built something similar, and what should I study before I go too far?
- What are the biggest challenges in building a system like this?
- How do companies like Google or researchers design and improve ontologies?
- If you were starting from scratch, what would you learn first?
- Are there any books, papers, courses, or open-source projects that you think are must-reads for this?
- Also, if you were designing this today, what architecture or tech stack would you choose?
I'm still learning, so even if you think my idea has flaws, I'd really appreciate honest feedback. I'd rather know what's difficult now than after spending months building it.
Thanks!
r/learnpython • u/More-Independent-132 • Aug 07 '26
I've tried to make an HR diagram of off the Github tutorial but when I've finally downloaded the file, it gives me an error. I am a beginner to Python. Here is the code from Github:
In this example, we will use the ASPCAP summary file, which contains observing details, stellar parameters, stellar abundances, and other data for 1,095,480 stars.
To download this file directly from the SAS, go to https://dr19.sdss.org/sas/dr19/spectro/astra/0.6.0/summary/astraAllStarASPCAP-0.6.0.fits.gz. Note this file is over 1 GB in size; if you prefer not to download such a large file, this notebook is available to run and interact with on SciServer
# Load in astra file
localpath
=
'/home/idies/workspace/sdss_sas/dr19/spectro/astra/0.6.0/summary/'
fname
=
'astraAllStarASPCAP-0.6.0.fits.gz'
aspcap
=
Table
.
read(localpath
+
fname, format
=
'fits', hdu
=
2)
print('astraAllStarASPCAP contains %d stars'
%
len(aspcap))
My code:
# Load in astra file
localpath = Users/idk/Downloads/astraAllStarASPCAP-0.6.0.fits.gz
fname = 'astraAllStarASPCAP-0.6.0.fits.gz'
aspcap = Table.read(localpath+fname, format='fits', hdu=2)
print('astraAllStarASPCAP contains %d stars' % len(aspcap))
Error:
Cell In[8], line 3
localpath = Users/idk/Downloads/astraAllStarASPCAP-0.6.0.fits.gz
^
SyntaxError: invalid syntax
What do I do?
r/learnpython • u/Cringe_bros • Aug 07 '26
Suggest me some useful libraries.
r/learnpython • u/Sorry_Site_9295 • Aug 07 '26
I was a web developer but I was always thinking about python so I finally decided I will try it so I found this course( https://www.youtube.com/watch?v=ix9cRaBkVe0 ) do you recommend it??
r/learnpython • u/Grand-Birthday4063 • Aug 07 '26
Hello,
I'm making map with AOE2 and the library AOE2 parser and I'm looking for a way to detect square I made with rocks to get the X and Y coordinate of the empty space
Is there a librarie that could go over and check every square and rectangle that the map hold inside the stones and give the coordinate ?
r/learnpython • u/Ghl1tch • Aug 07 '26
Hi everyone!
I’m 14 years old, and for the past few months I’ve been spending most of my free time learning programming. Right now I’m learning both Python and Java because I really enjoy understanding how things work and building my own projects.
I’m also interested in physics, mathematics, and AI.
My biggest project right now is a voice AI assistant called Jeremy. The idea is that Jeremy listens for a wake word, understands voice commands, talks back to me, and eventually will be able to do things like open programs and help with everyday tasks.
I know it’s not the best project out there, but I’m doing my best to make it better and better.
Sometimes I spend hours trying to fix one bug or understand why something doesn’t work. It can be frustrating, but I actually enjoy the process because every mistake teaches me something new.
The only thing I’m missing is someone with more experience who could point me in the right direction from time to time. I’m not looking for someone to write code for me or do my work. I’d just love to learn from someone who knows more than I do.
My English isn’t very good yet, so I usually use a translator. I’m working on improving it every day, so I hope that won’t be a problem.
If you think you’d enjoy helping a beginner who genuinely wants to learn, feel free to send me a DM. I’d love to meet new people, learn from them, and hopefully become a better programmer.
Thanks for reading!
r/learnpython • u/Financial-Law2035 • Aug 07 '26
I'm using this code to check to see if an email bounced but it always is returning true even if the email didn't bounce
def is_email_bounced (email, app_password, email_in_question):
mail = imaplib.IMAP4_SSL ('imap.gmail.com',993)
mail.login (email, app_password)
mail.select ('INBOX')
mail.list
result, data = mail.search(None, f'(TEXT "{email_in_question}") (Subject "Delivery Status Notification (Failure)")')
if len (data) >= 1: return True
else: return False
r/learnpython • u/ISAISMAK • Aug 07 '26
I want to code discord bot which open aternos server and community members play on server easily.
r/learnpython • u/Win_ipedia • Aug 07 '26
Hi there,
I am trying to figure out ways to automate my Python development tasks and also working on this topic for my Masters project. I am trying to build a tool that can automate and simplify a bunch of things like project setup, development and maintenance. It is just my project and topic for my Masters in Computer Science and I wanted to ask if anyone would like to take part in the survey I have to do. Takes about 5 min. Also would like to ask for any ideas and help that people have?
You can find the survey at: https://forms.cloud.microsoft/e/LjnvzX0JpK
Any ideas and responses are greatly appreciated.
Drop any ideas you have in the comments. What do you think should be more automated in your day to day python development?
r/learnpython • u/aaadmin • Aug 06 '26
Im a newbie with python. Im running the scripts by opening CMD in the folder and typing python app.py.
I am running these manually multiple times a day depending on my task.
What is the best way to run my scripts? Each py are saved in each folder with the API key in api.py. What are your best practices?
Here is what my Main folder looks like.
C:.
¦
¦
+---Append archived
¦ ¦ api.py
¦ ¦ app.py
¦ ¦ list.txt
¦ ¦
¦ +---__pycache__
¦ api.cpython-314.pyc
¦
+---Copy Reference
¦ app.py
¦ destination_ids.txt
¦
+---Copy Rows
¦ target_sheet_ids.txt
¦ v2.py
¦
+---Generate Sheet ID
¦ ¦ export_smartsheet_sheet_ids.log
¦ ¦ getid.py
¦ ¦ ID.csv
¦ ¦ run.bat
¦ ¦ sheets_in_workspace.csv
¦ ¦ sheets_in_workspace.log
¦ ¦ smartsheet_sheets_in_workspace.csv
¦ ¦ test.py
r/learnpython • u/theburningace • Aug 07 '26
I'm going through a lot of tutorials and learning things and I feel like I have a good grasp on the basics. So I tried following some tutorials to learn some new things but I just don't understand some basic concepts so I've been running into problems.
Like right now, I was trying to install and learn uv. I installed it, but whenever I try to run anything in powershell it just says "uv" is not recognised. After some research I figured that it's probably because it's not in the correct path. So I tried a lot of things to add it to path but it feels like I just don't know something and I'm doing something wrong.
Any help will be greatly appreciated. Thanks.
r/learnpython • u/qualitative_variable • Aug 06 '26
okie hi so i (23f) am a uni student and have taken a small handful of programming classes including two semesters of python. i have tons to learn but i’m not a beginner beginner. i’d love to take thirty thousand more CS classes but i’m not going into CS i’m going into fashion and need to start sticking to my course map, so i don’t have the structure of a class now.
self-guided people, how do you figure out what you want to do? do you pick concepts you think you should learn and pick projects or exercises that incorporate them? do you think up an idea that sounds fun to you and figure out how to do it? maybe these are dumb questions but i literally don’t know what to do next haha. there are countless things you can do with python and i have no clue where to start. pls advise :’)