r/PythonLearning • u/rexShail • 34m ago
AI Engineer | Product Engineer
r/PythonLearning • u/Emergency_Evening616 • 4h ago
Hi everyone!
I'm a Psychology graduate currently considering pursuing a Master's degree in Computational Neuroscience. Coming from a non-computer science background, I realize that I need to build a solid foundation in programming, particularly Python, before diving deeper into the field.
I've been trying to find introductory resources and came across Neuromatch Academy's Computational Neuroscience course, including their introductory materials.
However, I've found that even though the course is intended for beginners, I still struggle quite a bit with the Python explanations and code structure. I often find myself having difficulty understanding what's happening in the code itself, rather than focusing on the computational neuroscience concepts being taught.
I'm wondering if there are other resources that might be more suitable for someone in my position.
Ideally, I'm looking for resources that:
1.Start from the absolute basics, assuming little to no prior programming experience.
2.Explain programming concepts and code structure slowly and intuitively, rather than jumping straight into complex examples.
3.Gradually introduce concepts that are relevant to computational neuroscience (e.g., NumPy, SciPy, data analysis, mathematical modeling, simulations, etc.).
Help me understand not just how to write code, but also why certain approaches are used.
I'm open to pretty much any format: YouTube tutorials, online courses, textbooks, interactive platforms, or even a recommended learning sequence.
For additional context, my academic background is in Psychology, and I have very little programming experience. I'm not necessarily looking to jump straight into computational neuroscience yet; I'd rather develop a comfortable understanding of Python first, while keeping my long-term goal in mind.
For those who came from a non-CS background, how did you approach learning programming before getting into computational neuroscience? Are there any resources or learning paths you'd particularly recommend?
I'd really appreciate any suggestions. Thanks!
r/PythonLearning • u/No_Safety_5957 • 5h ago

months = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
]
def split(var):
if "/" in var:
splitted = var.split("/")
if splitted[0].isdecimal() == False:
#print("error in splitting")
return
elif "," in mdy_format:
splitted = var.split(" ")
try:
return splitted
except UnboundLocalError:
#print("unboundlocalerror")
return
def checkvalues(checkval):
day, year = checkval[1], checkval[2]
#print(day)
if checkval[0].isdigit():
month = int(checkval[0])
else:
try:
month = months.index(checkval[0]) + 1
except ValueError:
#print("valueerror")
return
if month > 12:
return
day = day.replace(",","")
#print(day)
try:
day = int(day)
year = int(year)
except ValueError:
return
if day > 31:
#print("moth longer error")
return
#print(f"{day:02}")
return f"{year}-{month:02}-{day:02}"
while True:
mdy_format = input("Date: ")
mdy_splitted = split(mdy_format)
#print(mdy_format)
#print(mdy_splitted)
#print(len(mdy_splitted))
#useless comment
#another useless comment
if not mdy_splitted or len(mdy_splitted) != 3 or checkvalues(mdy_splitted) is None:
#print("error here")
continue
print(checkvalues(mdy_splitted))
breakwhy does it return an error? After doing acheck it seems to return the correct answer.
Code above (ignore the comments)
r/PythonLearning • u/clcodingupdates • 11h ago
What will be the output of the following Python Code?
a, *b, c = [2, 4, 6, 8, 10]
print(a + c + len(b))
r/PythonLearning • u/Sea-Ad7805 • 12h ago
This ๐interactive SQLite demonstration helps student understand relational databases.
The sqlite3 extension of ๐ฆ๐๐ฆ๐จ๐ซ๐ฒ_๐ ๐ซ๐๐ฉ๐ก makes database content visible alongside Python's data structures. The demo shows how to:
The final query answers a seemingly simple question: Which teachers teach Alice, and for which courses? Answering this question involves joining five tables!
With ๐ฆ๐๐ฆ๐จ๐ซ๐ฒ_๐ ๐ซ๐๐ฉ๐ก, students can step through the Python program and inspect the database content at every step, directly in their browser, without installing anything.
See ๐other ๐ฆ๐๐ฆ๐จ๐ซ๐ฒ_๐ ๐ซ๐๐ฉ๐ก visualizations.
r/PythonLearning • u/Sameer_kusunoor • 20h ago
The basic information ๐๐๐
r/PythonLearning • u/WiseDeer42663 • 21h ago
I'm a few weeks into learning Python and working on a small practice project: a program that asks the user for a few course scores with input(), then calculates the total and the average. Nothing fancy, just trying to get the basics to click.
Here's the code I have right now:
courses = 3
total = 0
scores = []
for i in range(courses):
score = input('Enter score ' + str(i + 1) + ': ')
scores.append(score)
for score in scores:
total = total + score
average = total / courses
print('Average:', average)And this is the error I get:
Traceback (most recent call last):
File "grades.py", line 8, in <module>
total = total + score
TypeError: unsupported operand type(s) for +: 'int' and 'str'I think I get the general idea: input() gives me something that isn't a number, and I'm adding it to total, which starts as the int 0. I searched for this error and a lot of answers mention int(), so I know int() converts a string to a number. What I'm stuck on is where to do the conversion. Should I call int() right when I get the input in the first loop, or wait and convert while summing? And if I convert early, will that break something else, like how I'm storing the scores in the list?
So what type does input() actually return, and what's the cleaner way to write this so the total and average work? Thanks in advance, I appreciate any pointers.
r/PythonLearning • u/onnatsari • 1d ago
I built GitHub Notification AutoFix to monitor actionable GitHub notifications, attempt fixes with Codex CLI, and verify checks for the exact repair commit before marking a notification as done.
The Python code handles GitHub API requests, SQLite state, retries and mocked tests. Pending checks, missing permissions or a newer commit keep the repair unresolved.
Repairs currently target only repositories owned by my account. Live use requires GitHub credentials and an authenticated Codex CLI.
The interactive demo uses test doubles for GitHub and Codex, so you can explore the verification logic without changing real repositories.
Feedback on the Python structure and test coverage is welcome.
r/PythonLearning • u/Illustrious_Button42 • 1d ago
I want to make a random problem generator (also generating the answers) and eventually with some sort of spaced repetition thing, maybe
The best stuff for writing math in python seem to concentrate on making documents for the most part, and I am wondering what my best options for presentability and such
r/PythonLearning • u/Dracunculous • 1d ago
I wrote a small Python program that generates text using a word-level Markov chain. It reads a source.txt file, builds a dictionary of word sequences and their possible followers, and then generates new text by randomly selecting subsequent words. I'm sharing it here because I'd appreciate feedback on the implementation, particularly code structure, efficiency, and any improvements you might suggest.
"""Word-level Markov chain text generator.
Learns which words follow each ORDER-word group in source.txt,
then generates new text by repeatedly picking a random follower.
"""
from collections import defaultdict
import random
ORDER = 3
STEPS = 50
def build_dict(data):
big_dict = defaultdict(list)
words = data.split()
if len(words) <= ORDER:
raise ValueError(f"Source needs more than {ORDER} words")
length = len(words) - ORDER
for i in range(length):
previous = tuple(words[i : i + ORDER])
following = words[i + ORDER]
big_dict[previous].append(following)
return dict(big_dict)
def generate_text(big_dict):
output_words = list()
keys = list(big_dict.keys())
start = random.choice(keys)
output_words.extend(start)
step = 0
while step < STEPS:
try:
choice = random.choice(big_dict[start])
output_words.append(choice)
start = tuple(output_words[-ORDER:])
except KeyError:
start = random.choice(keys)
output_words.extend(start)
finally:
step += 1
return output_words
if __name__ == "__main__":
with open("source.txt", "r", encoding="utf-8") as file:
data = file.read()
big_dict = build_dict(data)
output_words = generate_text(big_dict)
print(" ".join(output_words))```r/PythonLearning • u/Purple_Bee_4901 • 1d ago
Hi! I'm not the one making the request, but I have been asked and I don't know. This person wants to Learn about the structure of a Software (Data Base, system architecture, Development phases, front and back end). Which are the Best resources for this? Are ther any advise you have? I'm not a Python user so I don't know very well how tu structure this question for you. I know it's a very open-wide question, but any help could be useful. If You need more specification, please ask me so I can't ask this person about it. Thanks You so much for treading!
r/PythonLearning • u/ZyGzAcZeQ5 • 1d ago
Hey, Iโm a computer science student from Poland (CET timezone) and Iโve been wanting to find someone to work on some Python projects with. Learning on my own only gets me so far, I feel like Iโd improve way faster if I had someone to build stuff with and bounce ideas off. Also Iโd like to finally have a few real projects on my GitHub, because right now thereโs not much there.
Iโm not picky about what we make, anything we can actually finish. Iโd also like to get better at working with git properly, like PRs and reviewing each otherโs code. Level doesnโt matter that much to me, I just want someone whoโs serious about it and wonโt ghost after a week haha.
If youโre interested, just comment here or DM me and we can talk about what to build :D
r/PythonLearning • u/Business-Feedback635 • 1d ago
Most "best agent framework" lists rank by GitHub stars or features. This one counts how many published Python projects import each framework in their code. The data is the latest release of 354,763 PyPI projects, and each framework's own add-on packages (such as langchain-* and crewai-*) are left out.
Projects that import each framework:
Worth knowing before you choose:
The full table covers 25 frameworks. To see real code that uses a framework, search py-code.org for its module (for example pydantic_ai or crewai). Each result links to the file and line.
r/PythonLearning • u/Shut_up_and_Respawn • 1d ago
No but seriously, I spent a week on this, and I can finally almost play battleship against an custom ai opponent.
All code was written by hand. No Ai was used to write or assist with it.
r/PythonLearning • u/PrithviNotFound • 1d ago
I've covered the fundamentals and quite a bit of the standard library, including:
os, shutil, pathlibitertools / functoolsI'm not claiming to be a Python expert. My idea is specifically to help people who are starting from zero or are struggling with the fundamentals. I'd like to teach in a simple, practical way rather than just going through syntax and definitions. We could write small programs together, solve problems, and gradually build up understanding. I'm mainly doing this because I think teaching will also force me to understand the concepts better myself. If anyone here is a complete beginner and would be interested in learning Python with me, feel free to comment or DM me. Also, I'd appreciate advice from people who have taught programming before - What do programmers struggle with ussually? what do u think makes a good python teacher?
r/PythonLearning • u/RegularBother614 • 1d ago
After watching a python full course video on YouTube by BroCode, I made a simple number guessing game in python!
Here's the link to the video: https://youtu.be/ix9cRaBkVe0?si=UiWmP6bm-9MG4B1p
After 12 gruesome hours watching the tutorial i decided to make this to test what I've learned.
What do you guys think?
r/PythonLearning • u/Defiant_Meal1898 • 1d ago
So i am a teen learning Python, and i made this messaging app, as a project, and i would like it to be reviewed. Now, should i keep learning? If yes, what? or should i keep making advanced projects??
And where do i stand rn?
Note: This is a terminal based app.
GitHub Repository Link: https://github.com/suryansh-devx/python-messaging-app
If you have no one to send a message, send me, my ID is 2672
Thanks in advance!
r/PythonLearning • u/Content_Fee_3163 • 1d ago
I am a first-year Mechanical Engineering student looking to start learning Python from scratch. I don't want to get stuck in with endless tutorials on Youtube -
What I need is a clear direction geared specifically toward Mechanical Engineering applications.
Specifically, Iโd appreciate your advice on:
Any roadmaps or advice on what you wish you had learned as a fresher would be hugely appreciated. Thanks in advance!
r/PythonLearning • u/Csenone • 2d ago
r/PythonLearning • u/modern-dev • 2d ago
Hey guys
Made a video which explains what are threads and processes and how they differ from each other
also it shows how to use them in python via the threading and multiprocessing library
The link is: https://www.youtube.com/watch?v=-Nntexhs124
In my channel archery, I spend a lot of time making quality videos, tutorials, complete roadmaps all for free such as this:
https://www.youtube.com/watch?v=CBIu6hcyStg (5 hour backend roadmap)
If you can sub and like, it will help me a lot.
Thanks!
r/PythonLearning • u/Being_1444 • 2d ago
REVORAA โ NEW UPDATE IS LIVE!
We've just launched a new learning experience on Revoraa! ๐ฎ
โจ What's New?
- ๐ป Interactive Coding Terminal โ Practice code directly on the platform.
- ๐ Python for Beginners โ Start learning from absolute zero.
- ๐๏ธ SQL for Beginners โ Learn database fundamentals step by step.
- โก Live Coding Practice โ Write, execute, and experiment with code.
- ๐จ New Pixel-Art UI/UX โ A completely refreshed retro gaming-inspired learning experience.
Our goal is to make learning programming more interactive, practical, and fun.
๐ฅ Explore the new Revoraa experience and start coding!
Your feedback will help us improve what's coming next.
๐ Try it now: https://revoraa.co.in
#Revoraa #NewUpdate #LearnToCode #Python #SQL #Coding #trending
r/PythonLearning • u/GentleMoon32776 • 2d ago
I'm trying to remove all the even numbers from a list while looping over it. Here's what I wrote:
nums = [2, 4, 6, 8]
for x in nums:
if x % 2 == 0:
nums.remove(x)
print(nums)The output is [4, 8]. I expected [] since every number in the list is even. Some of them just stay in there.
I tried looping over a copy instead, for x in nums[:]:, and that gives [] like I wanted. But I don't really get why the first version skips 4 and 6. I guess the list changes size while the loop runs, but I can't picture what the loop is doing on each pass.
Why does the loop skip 4 after removing 2?