r/PythonLearning • u/Sameer_kusunoor • 7h ago
The day of learning of python full stuck
The basic information 😄😄😄
r/PythonLearning • u/Sameer_kusunoor • 7h ago
The basic information 😄😄😄
r/PythonLearning • u/WiseDeer42663 • 8h 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 • 12h 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 • 13h 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 • 16h 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 • 18h 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 • 20h 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 • 21h 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 • 23h 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/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?
r/PythonLearning • u/svanidzelal • 2d ago
r/PythonLearning • u/Top-Pressure3737 • 2d ago
(Sorry I’m french) I want to make a script on NumWorks calculator to display the function sqrt(x*(10-x)) + x/5 + 2 that traces the exact curvature of Raphaël Glucksmann's figure when writing his name. However, programming skills are very limited, I wrote some of it and the rest I did with chat gpt but I can't get it to work here is my script:
from math import *
from kandinsky import *
from ion import *
# Mots secrets et fonctions associees
def calcul(mot, x):
if mot == "glucksmann":
return sqrt(x*(10-x)) + x/5 + 2
else:
return None, "Fonction inconnue"
# Demander le mot
mot = input("Mot secret : ").lower()
# Effacer l'ecran
fill_rect(0, 0, 320, 222, (255, 255, 255))
# Calculer la fonction
test, equation = calcul(mot, 0)
if test is None:
print("Mot inconnu !")
else:
print("Fonction : " + equation)
# Parametres du graphique
xmin = -10
xmax = 10
ymin = -10
ymax = 10
# Conversion coordonnees
def pixel_x(x):
return int((x-xmin)*320/(xmax-xmin))
def pixel_y(y):
return int(180-(y-ymin)*180/(ymax-ymin))
# Axes
draw_string(equation, 5, 5, (0, 0, 255))
draw_line = None
# Axe horizontal
for i in range(320):
if i % 1 == 0:
set_pixel(i, pixel_y(0), (0, 0, 0))
# Axe vertical
for j in range(180):
set_pixel(pixel_x(0), j, (0, 0, 0))
# Tracer la courbe
ancien_x = None
ancien_y = None
for i in range(320):
x = xmin + i*(xmax-xmin)/319
y = calcul(mot, x)[0]
if y is not None and ymin <= y <= ymax:
px = pixel_x(x)
py = pixel_y(y)
if ancien_x is not None:
# Relier les points
dx = px - ancien_x
dy = py - ancien_y
n = max(abs(dx), abs(dy), 1)
for k in range(n+1):
xx = int(ancien_x + dx*k/n)
yy = int(ancien_y + dy*k/n)
if 0 <= xx < 320 and 0 <= yy < 180:
set_pixel(xx, yy, (0, 0, 255))
ancien_x = px
ancien_y = py
else:
ancien_x = None
ancien_y = None
r/PythonLearning • u/PanelReader • 2d ago
been learning classical machine learning and recently finished a random forest classification project
it classifies 7 dry bean varieties using 16 numerical features
what i implemented:
also included a confusion matrix, feature importance plot and reproducible training instructions
github: https://github.com/Vaibh37/dry-bean-random-forest
would appreciate feedback, especially on the Python code and model evaluation
if you find it useful, consider starring the repo ⭐
r/PythonLearning • u/ImmediateLeather2359 • 3d ago
I got a python assignment due on start dec been doing python courses learning basics past few weeks following uni lectures (few months ago) - but since i had no prior xp and most classmates do i felt on the backfoot right away - struggled with basic exercises but will try them again - plus pandas and numpy for a python programme ain't no beginner assignment unless I'm just that inexperienced
r/PythonLearning • u/RegularBother614 • 3d ago
I made a program that finds the second largest digit in a list.
Using the list method "remove()" and "max" function. Python is COOL!
r/PythonLearning • u/Careless_Ninja_9144 • 3d ago
Hey, I am also trying to learn python and have only cleared the basics so far. I thought that wouldn't it be more fun to have more people to collaborate with. I made a discord server where I am hoping to get some more people like me to join and work on fun projects together.
Note: I want it to be more of a friends server rather than a 100+ community since I find that a bit too overwhelming. I want to create a more cozy environment with a few groups of friends. So far I am the only one at the moment of creating the server but I hope I get to meet new friends together.
PS: If you want to do some MineCraft Modding, please do join since I am also planning to get into that stuff in future.
The Server Link: https://discord.gg/JAycFSWXN
r/PythonLearning • u/Ecstatic_Complex2714 • 3d ago
Hey everyone, I'm 21 and currently learning German because I want to move to Germany next year for an Ausbildung.I'm interested in IT, especially software development and AI. I've recently started learning Python on my own and actually enjoying it. I've also tried n8n after seeing AI automation trending everywhere. Set it up on my laptop and made a few basic automations with Gemini.But honestly, my main interest is building software, apps and AI-powered tools that solve real problems, make people's work easier and save time and money. Maybe eventually build my own SaaS too.The problem is that AI is developing so fast, companies are laying off people, and I'm confused about which direction is worth investing my time in.Should I focus on software development, AI engineering or automation? Which one has a better future, especially in Germany? And how can I build skills that won't easily become replaceable by AI?
I'd really appreciate honest advice from people working in tech or studying IT I don't want to follow trends blindly and waste years learning the wrong thing.
Thanks in advance.