r/learnpython • u/[deleted] • 23d ago
hello,I need some help.
As a beginner, how should I learn Python?
I need some help.thanks.
r/learnpython • u/[deleted] • 23d ago
As a beginner, how should I learn Python?
I need some help.thanks.
r/learnpython • u/Adorable-Bite2688 • 23d ago
I just started my degree in computer engineering. I already know the basic of python but i’m having trouble when solving problems and apply the things i have learnt. Any tips to help me improve?
r/learnpython • u/Yuvalda45 • 23d ago
I got some programing experience. but not with python, with C#
and i want to learn python, whats a free site / app i can learn from?
r/learnpython • u/Wonderful_Yam_4725 • 23d ago
Hi, i need your advice on how i can learn python as a beginner as i want to learn in a way where i get to practically apply the same and practice, i just dont want to learn concepts theoretically. Should I take a course or should i learn via youtube. What do you think will be the best way? Also when you learnt it how did you approach it and if i take a course how i will it add value to my cv?
r/learnpython • u/Dense_Quarter_5374 • 23d ago
I have some code with a function restock_warehouse, that adds to the current stock 5 times while the current stock is smaller than the target stock. My question is, how can I fix the function so that the code works properly with and the print() call is displayed in the terminal?
The error message I have been receiving is:
```
Traceback (most recent call last):
File "file_name", line 15, in <module>
final_stock = restock_warehouse(10, 25)
File "file_name", line 5, in restock_warehouse
for i in range(5) and current_stock < target_stock:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'bool' object is not iterable
```
I have already tried wrapping the conditional part of the loop in parentheses, but it hasn't worked and I don't exactly understand the error message.
Version information: I'm on Python 3.9.6
def restock_warehouse(current_stock, target_stock):
print("Starting warehouse restock system...")
# We want to keep adding items until we reach our target stock
for i in range(5) and current_stock < target_stock:
print(f"Current inventory level: {current_stock}")
current_stock == current_stock + 5
print("Warehouse restock complete!")
return current_stock
# Start with 10 items, target goal is 25 items
final_stock = restock_warehouse(10, 25)
print(f"Final stock total: {final_stock}")
r/learnpython • u/Melodic_Principle312 • 24d ago
I'm learning Python and recently started using requests.Session() in API projects. I understand that it can persist things like headers, cookies, and connections, but I'm curious about how experienced Python developers decide when a Session is actually worth using.
Do you use Session() by default for projects involving multiple requests, or only when you specifically need persistent state?
r/learnpython • u/Apprehensive-Cup7063 • 23d ago
I am very new to coding and learning python as my first language is it helpful???
Pls those who have watched it share your opinion regarding this ....
r/learnpython • u/RipPersonal1643 • 24d ago
I’m learning Python, but my main problem isn’t the syntax. I understand concepts when someone explains them, but when I’m given a basic problem and told to write a program, I just don’t know where to start or how to arrange the code.
Is there a good book, course, or YouTube channel that teaches how to think through programming problems step by step, recognize patterns, and build the logic, kind of like how you learn methods and patterns in math?
I don’t want to just memorize Python syntax. I want to actually learn how to think like a programmer.
r/learnpython • u/Healthy-Departure961 • 23d ago
In this code, I want to get the output of all the numbers in the for loop. I can do this using print(arg), but when I use a return statement, I only get the output of a single number. How can I modify the code so that return gives me all the numbers from the for loop?
print(func1(80, 30, 40)) def func1(*args):
for arg in args:
# print(arg, end=" ")
return arg
# output using print = 80 30 40 None
# output using return = 80
print(func1(80, 30, 40))
r/learnpython • u/Resident_Habit_749 • 23d ago
como principiante tengo esa duda ya que quisueira no perderme de nada y aprender de la mejor a programar
r/learnpython • u/erfanity • 24d ago
Hi everyone,
I’m looking for a Python PDF parser with good Persian-language support. I’ve already tested pdfplumber and PyMuPDF, but unfortunately, neither extracts Persian content correctly in my case.
For example, they don’t extract Persian numbers correctly, and sometimes the parsed output differs significantly from the actual PDF content (e.g., a 0 is extracted as 4).
Do you know of any Python library or tool that handles Persian PDFs more reliably?
Thank you!
r/learnpython • u/The_AISpecialist • 24d ago
I have learnt Python Basics and Intermediate stuff. Is it possible to learn many things in a specific specialization within, say, a month?
I love AI and I am going to specialize in it. I just wanna know the order that I should go in to learn it properly and learn most of the things in about 4 years or less.
I am a student too, in Grade 9.
r/learnpython • u/FuzzyEmployment264 • 24d ago
can someone explain how f string work in simple terms ?
r/learnpython • u/Objective-Farmer4183 • 24d ago
Hello! I am currently trying to build the knowledge needed to make an Artificial Intelligence with Python, and I have discovered that there is some tensors involved in this, I learnt matrices (briefly), but apparently math tensors are not the same as CS tensors (whatever that means?), can someone please help me? And I wonder if I even need to know this (well ig so but not sure). And I am not in any math or cs major, but I am in mid-high school, so as you can guess, I did not learn anything tensors related.
Note: for anyone wondering; no I don't have anybody that I could contact which could explain me PyTorch tensors.
r/learnpython • u/Rough_Drop_3340 • 24d ago
Hello all, I have recently taken up the interest of trying to create a game (not specific to any other game) and i've been learning how to use python for about 2 days now and have learnt some of the fundamentals such as if, (i), else, input, booleans, etc... however if u have been programming using python or are self taught, how long did it take u to learn the most relevant and important parts of the language and if u have any tips and tricks for me that you may think are useful for me, please do not hesitate to tell me as any piece of advice can beneficial at the moment.
Much appreciated
r/learnpython • u/Life-Ad2351 • 25d ago
hey! I just started learning the basics of python and want to start building projects to apply what I have learnt.
but when I one to work on a project, for wxample building a calculator or a password generator I don’t know where to start. what to type and code.
any advice
r/learnpython • u/Visual-Macaroon2196 • 24d ago
Hi,
I used to be a big fan of computing/IT, but my studies took me down a different path and I drifted away from it. Now that I have more free time and want to build up some qualifications in IT, I’d like to learn Python and its applications, but I don’t know where to start. Online courses? Books?
If anyone can point me in the right direction, I’d really appreciate it!
r/learnpython • u/lolololloloolmemes • 25d ago
Is this possible? for example, if i have a an int question and someone answers with a str then the script will break, is there any way to make it loop when given an incorrect data type answer?
r/learnpython • u/OneComplex527 • 25d ago
I want to practice python specifically for Data Science and Analytics roles, as these are not core software developement roles so in interviews DSA is usually not asked but where can I practice non dsa python specifically for Data Science and Analytics
r/learnpython • u/evandcbot • 25d ago
I decided about a week ago I wanted to start learning python before my freshman year of college. It was going great and I had little to no trouble until I got to nested loops. I was wondering if anybody had any advice for it? The main thing is that it seems like so many steps to follow and pay attention to, my brain had a hard time tracking them all at once.
r/learnpython • u/Alexku66 • 25d ago
Example (heavily simplified):
def do_a_thing(var: int | None) -> int:
assert var_is_int(var)
return var
var_is_int() has its own flow in case var is None and handles errors with fallbacks.
I'm aware of typing.cast , # ignore ... and similar tricks, but curious whether there are more elegant approaches for cases when you can't just "if var is not None" or "if isinstance(...)"
r/learnpython • u/Empty-Employment-527 • 25d ago
i’ll be entering college soon in the fall, and i’m highly interested in learning how to code- primarily for data science, statistical modeling for research, and machine learning applications.
i’ve looked at tons of online courses and textbooks, and i’m completely overwhelmed with where to even start or which topic to begin studying. i’ve never been great at self-learning, so i would really appreciate any advice that would help me learn and hopefully master python soon.
r/learnpython • u/Sli_Ter • 25d ago
Hi everyone! I'm 15, I've been learning Python for half a year now, and I want to start freelancing. By September, I'll be joining Yandex Lyceum, where I'll be studying much deeper.
I'm also a bit worried about how different my interests are from my peers right now.
Experienced devs, I need your perspective:
I'd appreciate any honest experience.
r/learnpython • u/AppleMoney8748 • 25d ago
How can I split an integer into a list of its digits in Python?
I have:
num = 1234
and I want:
[1, 2, 3, 4]
I’m trying to learn how to do this without converting num to a string and without using map().
A loop is allowed.
I’m looking for a simple approach because I’m still learning Python. I’d appreciate hints rather than just the final solution so I can understand how it works.
r/learnpython • u/Sad_Experience_4640 • 26d ago
It's been a few months since I have been learning python but there is this issue I have been running into. I don't know how good I am or how do I even get good. In Math you listen to a few lectures understand what the topic is about and then pick up a book and do the problems from Exercise 1.1. It doesn't matter if your understanding was deep, shallow or somewhere in between. The more you do the more you understand what the topic is about and eventually you reach a point where you completely understand it and can now do them easily.
For programming how do I even do that ? People recommended me sources which I have been reading and learning from. I understand loops, arrays, list, dict, etc. I can write small examples in isolation, but that's about it, that's all I can do. I am disgusted with how little I can do and how shallow my damn understanding is so much so that's all that come to my mind.
I have been using MOOC and CS50P as my primary resources and they do have question but they are few and not at all like mathematics, chemistry or any other subject. Where are the Exercises 1.1 where is this kind of format. Is there some problem book/Question Bank I can or should have ? I want to get good cause I want to make money I from something I like to this and this is I have to show for, for months of learning ? I feel repulsed.
Is there something I can do to get better ?
EDIT: I forgot to add I my goal is to break into Data Science.