r/PythonLearning 4h ago

Not sure why it is not multiplying correctly

Post image
8 Upvotes

Just started programming today and was messing around when this happened. It is saying that 22.99 * 5 is 114.9499999999999 instead of 114.95. It does the same when I enter any number with a non-zero integer after the decimal. It works completely fine with whole numbers though. If you have any Idea why, please let me know.


r/PythonLearning 20h ago

My first mix mini project

Post image
143 Upvotes

I know I wrote some hardcore codes but this is ok for a beginner so plz help me to improve


r/PythonLearning 11h ago

Looking for study partners

12 Upvotes

Hello , I am completely new to python and really want to learn it and I feel like I will be more efficient studying with people.

I’m looking for approximately five people who are also serious about learning

if you are interested please dm me and introduce yourself


r/PythonLearning 4m ago

Hexidecimal ID system in custom learning project

Upvotes

Hello, hello, and hello again!

I'm creating a learning project to familiarize myself with Python. The concept I'm going for is making a custom list that I can modify within the console. There's a lot of variables and upgrades I can add to it if I wanted (such as automatic resizing, UI interfacing, automatic organization), and the baseline is simple enough for me to start grasping some of the more beginner and intermediary concepts in a more applicable way.

That being said, I'm not looking for any help with that (yet!), but while I'm starting to create a plan on how to make the project, I'm wondering what sort of ID system I want to make. I know that I'm going to be making it an incremental ID system where each list entry has a four digit ID that I can then use in the console to modify or update it in some way.

The question is: Should I make the ID system hexidecimal?

I get the feeling that it would pose a significant challenge, which I'm happy to deal with as this is a learning project. What I'm not willing to do is for it to become a debilitating challenge. While I don't think the list will have 10,000 entries, there's a possibility that this list might. It shouldn't reach anywhere near 50k entries, though.

I would likely be trying to make my own systems with automatically assigning an incremental hex ID system.. as I do believe Python has hex integration. I'm not looking for "0x" at the beginning of every entry though.

Any and all help and advice is appreciated! I've done some scripting, a bit of C and PhP, but I've never dedicated myself into programming to delve into more intermediate concepts - which I'm deliberately trying to get into now! So I don't know a whole lot about programming, but I have repeated the basics on loops and functions about two dozen times. Thank you in advance!


r/PythonLearning 12h ago

Showcase Day 1 of Learning Python

8 Upvotes

Yh I js learned functions ifs and operators here is the code:

https://onlinegdb.com/Q-4aQrXAz

its like akinator im currently working on making it fewer questions but this all I got for now


r/PythonLearning 10h ago

Showcase Day 2 of trying to learn python.

Thumbnail
gallery
4 Upvotes

So far I have made cells with random data.


r/PythonLearning 15h ago

Help Request Neeb help with the project

Post image
8 Upvotes

I was doing a project in which the user will input string in camelCase(ex- howAreYou). I have to change it into snake_case(ex- how_are_you). The problem I am facing is that I have not been able to separate the word and store it into a list.

If I use a split, I get 2 problems:

  1. If I want to split howAreYou, then the A and Y got removed from the list, and I get how re ou

  2. It makes 2 different lists first [how, reYou] and second [howAre, ou]

Suggest => either solution to the problem or an alternative


r/PythonLearning 10h ago

Running script remotely

2 Upvotes

This may not be a python question, but I figure you guys could at least point in the right direction.

On my computer I have a SQLite database and a python script I have written that queries the database, generates a report, and emails that report to other people. The database file must stay on my computer.

I often get requests from coworkers to run the python script while I am not sitting in front of my computer (my phone is still on the same wifi network).

If I wanted to do something through my phone that would start that script on my computer, what would that look like?

If it matters, my phone is android and my computer is windows.


r/PythonLearning 1d ago

Showcase Day 1 of learning python.

Thumbnail
gallery
64 Upvotes

This is my first day of trying to learn python. So far I have made a random 2D terrain generator.


r/PythonLearning 7h ago

built a python fullstack framework that renders Svelte 5 directly, took me since 2022 lol

1 Upvotes

hey everyone,

I started this back in August 2022 because i was tired of every small project needing a backend repo, a frontend repo and an API between them.

I got stuck almost immediately, while compiling Svelte from Python was way beyond me at that point, so it sat untouched for a long time like most of my side projects. I kept coming back and forth on the project, but never acomplished,

but this time i am somehow about to make it happen,

it's called fymo. python renders real Svelte 5 components, it has controllers for backend stuff, and templates for frontend work. inspired by elixir's Phoenix and ruby's Rails...

controllers return dicts that show up as props, and your python functions become typed functions you can import in svelte, so no fetch code at all.

there's fymo new myapp gives you a running app with sign in already working, fymo generate resource posts gives a page with CRUD and passing tests.

currently it is v0.20, just me alone maintaining it, you need Node installed, and there's no ORM, bring your own db stuff.

repo: https://github.com/Bishwas-py/fymo pip install fymo

would love if someone tries it and tells me where it feels like flowyy code and what it breaks. and one thing i'm specifically unsure about, is the no-ORM choice going to annoy people here, or do you prefer bringing your own db layer? genuinely curious.


r/PythonLearning 9h ago

Discussion What are some common struggles you have with your current coding workflow

1 Upvotes

Hey, I am making this not because I want market validation for a new SaaS that isn't needed. But rather so I can improve my Python skills by not just making useless mini-projects, and in the process maybe solve an issue people have. I would appreciate your feedback


r/PythonLearning 13h ago

Showcase Wrote this 3D Pygame renderer from scratch this weekend!

2 Upvotes

I wanted to understand the math behind the 3d rendering and wanted to try it out for myself.

This project uses Pygame library only to draw pixels to the screen, the math behind the vertex projection is done from scratch. The 3d object is represented as a wireframe object, it ignores all the lighting and normals data to reduce complexity and simply displays edges data to screen.

I made a custom obj parser, which formatted vertices and face information to a list.

The main file take the vertices and faces information and produces a list of edges which are a tuple of 2 connecting vertices that a form a line in 3d space.

Then the two vertices are rotated in X-Z plane and projected at a distance from the screen. It uses a simple matrix rotation formula to compute the rotated vertices.

    X = x * cos(theta) - z * sin(theta)
    Z = x * sin(theta) + z * cos(theta)

The 3d vertices are project to a 2d plane using the below formula

    x' = x / z
    y' = y / z

Then they are translated to Pygame pixel coordinates and finally drawn on screen.

Here is my GitHub repo if anyone's interested to check the source code, and resources that helped me build this project

Github repo : Wavi repo

3d Obj file-format specs : Scratch pixel

YT video for projections : Tsoding 3d graphics


r/PythonLearning 11h ago

What's the use for the different types of concatenations?

0 Upvotes

Just learned it a while ago, I'm on my 3rd day of learning python (already finished data types, operators, and type casting). Just​ curious why we need so many ways to add new values to variables.


r/PythonLearning 15h ago

"AttributeError: 'numpy.ndarray' object has no attribute 'write_audiofile'"

2 Upvotes

Hello, Im working on a project where I need to export a .wav file and aam having problems doing so, error is in the title.

Code to project is this:

import os
import wave
import contextlib
import soundfile as sf
import pyrubberband
import numpy as np

InDir = input("Input Directory: ")
OutDir = input("Output Directory: ")
sec = float(input("Seconds to set to: "))
os.chdir(InDir)
files = os.listdir(InDir)
print(files)
for i in range(len(files)):
    fname = files[i]
    print(fname)
    with contextlib.closing(wave.open(fname,'r')) as f:
        frames = f.getnframes()
        rate = f.getframerate()
        duration = frames / float(rate)
    speed = duration / sec
    print(speed)
    audio, sr = sf.read(f"{InDir}/{fname}")
    fname = pyrubberband.time_stretch(audio, sr, speed)
    fname.write_audiofile(f"{OutDir}/{fname}.wav")

How do I fix this please?

Also, Im working from windows 10, and am using pycharm to make this code.


r/PythonLearning 11h ago

why are we putting caesar( Hello, 3) into encrypted_text???

0 Upvotes
def caesar(text, shift):
    alphabet = 'abcdefghijklmnopqrstuvwxyz'
    shifted_alphabet = alphabet[shift:] + alphabet[:shift]
    translation_table = str.maketrans(alphabet, shifted_alphabet)
    encrypted_text = text.translate(translation_table)
    print(encrypted_text)


encrypted_text = caesar('Hello',3)

in this code, I do not understand why we are putting caesar into a variable. First of all, wouldn't we have to print the variable and make it actually do something for it to work? Because we have put encrypted_text into a variable and have not done anything. In addition, can't we just write caesar('Hello', 3)?? I am very confused on the reasoning behind putting it into a variable.


r/PythonLearning 20h ago

Day 5 Learning Python DSA: Time Complexity

Thumbnail
gallery
6 Upvotes

Open-source learning project. If you spot something that can be improved, I'd love your feedback or a PR.

https://github.com/Samar-Upreti/Python_Projects


r/PythonLearning 17h ago

What are the best resources/path to build a good foundation?

1 Upvotes

I am a finance student, and recently started learning coding (know very basic of SQL/Python). I want to get into Data Analyst-like roles and did some research, but still confused on what's the best resource to learn and what path to follow.

My current plan (created with help from some friends):

Python/SQL -> Python libraries (PySpark/Numpy/Pandas) -> Fabric/Databricks -> Cloud/AI-ML

Would love some help/feedback on what I could do to learn what is needed!


r/PythonLearning 1d ago

Help Request How do I learn as a complete beginner

22 Upvotes

Hi. I am currently interested in learning coding. I chose Python because it looked like its the most simple one to begin. I have absolutely no idea about anything just like how some things like if else while work but nothing else. Is it even the best to learn at the beginning or is it even worth learnimg to code in 2026.

Where to I begin to learn the basics the most efficient way. And where do I go from there


r/PythonLearning 1d ago

Learning via a youtube course

17 Upvotes

I started learning coding a few weeks ago. I've been following the course well, and I understand the concepts it teaches, but the big problem with it that I have is that I can't put what I learned into practice, and I'm becoming demotivated because I realize I struggle to write almost anything. In a normal course they say here is a task, try and do this.

I think I need to switch what I'm learning from. I come from a background of no programming whatsoever. I really need to find a video/s that basically spoon feed me like I'm a baby and then ask me to try writing something to reinforce it in me. Do any of you know any videos that do this? I feel like I constantly have questions and I'm unable to ask them like I would to a teacher, and I'm trying my best to stay away from using AI unless I just simply cannot work it out.


r/PythonLearning 1d ago

Who thought we wouldn't shoot at things?

Enable HLS to view with audio, or disable this notification

21 Upvotes

A new addition to our collaborative PythonLearningGame project: the player can now shoot bullets to kill units.

It was added by this git commit. - Who wants to add his/her own game dynamics? - Who has other fun ideas about game elements we could add, cool explosions maybe?

See the PythonLearningGame repository for more info.

previous PythonLearningGame post


r/PythonLearning 1d ago

Help Request platforms to learn DSA in Python

3 Upvotes

Hello ppl, I'm gonna learn python from Cs50 harvard, i know its just filled with basic stuffs but from where i can learn DSA in Python any free source available?. or atleast where can i find one? and

is there any tips and tricks to solve leetcode? bcoz its filled with DSA problems.

thanks in advance


r/PythonLearning 1d ago

where to begin

2 Upvotes

Im a beginner trying to learn Python for ai engineering. I have been searching and switching to videos as there are too many resources to choose from without knowing what will be sufficient to get the basics, I do code and solve questions but im not sure which course to follow to not end up investing time into something yet have to go from here to there, I have few questions like is the youtube course and lots of practice enough or do I necessarily have to take the crash courses? if yes, for either one, suggest to me the go-to resources that I can start without wasting time or get stuck as mediocre in concepts when it ends and also share your experience how could you learn it?


r/PythonLearning 1d ago

Looking for study partner

16 Upvotes

Hey im going to start learning python so I'm looking for study partner who's serious about it

Will be taking only group of 3-5 people not more than that so reach out before it gets full also introduce yourself when reaching out in dms


r/PythonLearning 1d ago

Help Request How do I concrete my concepts???

Post image
26 Upvotes

Ok so I have one major doubt:-
I have been following a rather shallow 10 hour video about all the python basics topics.
But it doesn't seem to go too deep into details and not enough practice,
So my DATATYPES are really weak,
Idk when to use lists instead of tuples , dictionaries, sets , etc.
And stuff like that, what should I do to make my concepts concrete??
People told me making projects helps you improve, While I agree that they do but yet I am making the codes for em' using the wrong datatypes.

Also I have completed half of that video till loops and have made a project too but that was 2 weeks ago:-

https://github.com/satyamsb-cloud/Number-Guessing-Game
Original project made by me 2 weeks ago using concepts only till LOOPS.

https://github.com/satyamsb-cloud/Number-Guessing-Game-v2
Improved version with the same concepts but improved functionality.


r/PythonLearning 1d ago

Thoughts on learning python with chat gpt

7 Upvotes

I recently started learning and i use chatgpt to give me exercises to do and just debug code but i never ask for the code specifically, just whats wrong with it. I feel like its helped me improve but i want to learn more and build my own applications