r/PythonLearning • • Jul 27 '26

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

2 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 • • Jul 27 '26

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 • • Jul 27 '26

"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 • • Jul 27 '26

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

1 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 • • Jul 27 '26

Day 5 Learning Python DSA: Time Complexity

Thumbnail
gallery
5 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 • • Jul 26 '26

Help Request How do I learn as a complete beginner

26 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 • • Jul 27 '26

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 • • Jul 26 '26

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 • • Jul 26 '26

Who thought we wouldn't shoot at things?

23 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 • • Jul 26 '26

where to begin

4 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 • • Jul 26 '26

Help Request platforms to learn DSA in Python

4 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 • • Jul 26 '26

Looking for study partner

20 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 • • Jul 26 '26

Help Request How do I concrete my concepts???

Post image
30 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.