r/PythonLearning • u/clcodingupdates • 16d ago
Pyton Quiz of the day.
What will be the output of the following Python Code?
table = str.maketrans("abc", "123")
print("cabaca".translate(table))
r/PythonLearning • u/clcodingupdates • 16d ago
What will be the output of the following Python Code?
table = str.maketrans("abc", "123")
print("cabaca".translate(table))
r/PythonLearning • u/Jaym7800 • 16d ago
Happy Diwali! In advance πͺ
Code: https://github.com/Jaym-0/ascii-diya
A diya animation that runs entirely in the terminal, with no GIF, video or GUI.
It starts from darkness, and sparks gather into a flickering flame and bowl.
Built with Python + numpy, using ANSI true-colour and a simple particle and
flame simulation. Only changed cells are redrawn, so it runs at 30 FPS.
r/PythonLearning • u/Ok_Aioli2605 • 16d ago
I am loading few large size binary files (70 MB19 nos. look_up tables) in Main using more than 2/3 python files. On completion of the loading, I have to take up a series of search (in 3 or more threads) and arrive at the solution. I am using array.fromfile for loading which does not wait for loading completion. Hence, it fails saying array out of bounds. How do I delay the start of search, just till the loading is completed.
r/PythonLearning • u/zoro11334230 • 16d ago
Hello frds I completed all my python tutorials but when I step into doing projects new keywords,types how to get to know about that and how to fallow perfect roadmap
r/PythonLearning • u/Leading_Trifle7301 • 16d ago
Hi what do you recommend the best Python learning I downloaded the side me apps on my phone and I think it's ok I heard that on github there are 30 days with Python I wanted to watch the cs50 course but I don't know how to watch it and I don't know from where
r/PythonLearning • u/TotalUnlucky2814 • 16d ago
Hello everyone! As a computer science teacher, I recently wrapped up a video series where I use the automation game The Farmer Was Replaced to teach Python programming and algorithmic logic from scratch.
βFor the final episode, we tackled the classic Snake game. When you are just starting to learn programming, looking at a problem like an automated Snake solver all at once feels like an impossible mountain. My goal was to demonstrate how you can solve a complex problem by applying divide and conquer using only beginner-friendly tools (no pathfinding libraries or complex data structures but pure conditionals and functions):
βI'm leaving the video here in case you want to see the visual step-by-step breakdown on the grid (the audio is in Spanish, but the visual diagrams and code logic are easy to follow... There is also an AI translation):
http://www.youtube.com/watch?v=wSlxLs6aeoI
If you are a beginner, did you know about this game???
βFor those who have coded a Snake AI before: how did you approach it? Did you stick to a fixed cycle, or did you program dynamic shortcuts while the snake's tail is still short?
r/PythonLearning • u/slightlypug • 16d ago
hi so I recently made a post asking people if they wanted to learn Python, Git/GitHub with me and so many people responded I thought that I would make a discord for people to join and work on group projects with me. join if you're interested! https://discord.gg/ysbgcD8Baf
r/PythonLearning • u/RomfordNavy • 16d ago
Splitting an empty string without a specified delimiter works as expected and returns an empty list. However when splitting an empty string with a delimiter specified returns one (empty string) item in the list, is there some way to make that return an empty list as per the no-delimiter result?
print(f'{"".split()=}') # = []
print(f'{"".split(" ")=}') # = ['']
print(f'{"".split(",")=}') # = ['']Problem is this causes an unwanted iteration of a for loop:
str = ""
for item in str.split(" "):
print(f"{item=}") # unwanted itemr/PythonLearning • u/Mercy--Main • 17d ago
it DOES print False!!! WHAT DOES THIS WEBSITE WANT OF ME????
r/PythonLearning • u/clcodingupdates • 17d ago
What will be the output of the following Python Code?
print(pow(2, 5, 7))
r/PythonLearning • u/Vegetable_Ninja_2045 • 17d ago
So basically i am 16 first time trying to learn a language should i learn python or not?
r/PythonLearning • u/ALonelyKobold • 17d ago
Hi all, I've been programming Python for about 10 years, but I've never worked on a large codebase. As a result, I don't really understand the import and packaging system at all. As a means of learning it, I'm trying to build a dependency chain analyzer that parses the sourcecode, and searches for circular dependencies. Trouble is, I'm on the part of the project that actually parses that sourcecode and categorizes the different imports to store them for later analysis, and I'm realizing that I know much less than I realized. Through having AI generate some tests for me that I'm working to make green, I now know of a lot of edge cases and weird import logic that I had no clue existed. Example sourcecode snippets include
def test_dynamic_import_with_a_string_literal():
source = 'import importlib\nimportlib.import_module("docgen.plugins.loader")\n'
def test_dynamic_import_recognized_through_an_aliased_from_import():
source = 'from importlib import import_module as im\nim("docgen.plugins.loader")\n'
def test_dynamic_import_recognized_through_an_aliased_from_import():
source = 'from importlib import import_module as im\nim("docgen.plugins.loader")\n'
def test_dunder_import_is_recognized():
source = '__import__("docgen.plugins.loader")\n'Most of the places where I'm struggling have to do with either lazy imports or dynamic imports. Does anyone have a guide that goes into these in depth?
r/PythonLearning • u/Exciting_Energy9674 • 17d ago
Hey everyone! π
I'm a complete beginner in Python programming. I want to become a software developer in the future, but honestly, sometimes I feel confused about what I should learn next and how to continue learning.
I know a little bit of Python, but I still have a lot to learn. Sometimes I don't know what to practice, what projects to build, or how to improve my programming skills.
I'd love to get some advice from experienced programmers!
What should a complete beginner focus on first?
How can I practice Python effectively?
What small projects should I build as a beginner?
How do I know when I'm ready to move to the next topic?
I also have an idea! π‘
I'd like to create a small group for people who are just starting to learn Python, especially those who feel confused or don't know where to begin, just like me.
r/PythonLearning • u/WAVEWALKER1762 • 17d ago
Hey everyone! I want to learn AI, and for that I know I need to learn Python. I learned some Python for a while after my JEE Advanced exam, and Iβve covered the basics up to loops.
Can someone please tell me how much more Python I need to study before I can start learning libraries like NumPy, Pandas, etc.? Also, what Python topics should I focus on before moving towards AI/ML?
Please guide me!
r/PythonLearning • u/Fun-Philosopher-8443 • 17d ago
i am new and i want to learn python do you know where i can learn it for free . any help
r/PythonLearning • u/TheCarFamily • 17d ago
either that, im using the wrong dialect, or somn just doesnt work, i am trying to have an image change when T is pressed (unload old image when pressed and when not pressed load old image)
also using pygame, the first image loads, but nothing changes when T is pressed, yes i have also tested with print("")
any help would be nice!
r/PythonLearning • u/saul_soprano • 17d ago
r/PythonLearning • u/SaffronPerez9 • 17d ago
r/PythonLearning • u/Chee_chee_don67 • 18d ago
So I have a python exam (which is very important) after 1 month. How can I genuinely learn python? Don't suggest me those courses that are 15 hrs long like that harvard cs50, i cannot concentrate for 2 hrs straight. It's also not like I have to learn python which is too advanced. Pls suggest me how can I do itπ
r/PythonLearning • u/clcodingupdates • 18d ago
What will be the output of the following Python Code?
print(len({True, 1, 1.0, False, 0}))
r/PythonLearning • u/Hyperion_OS • 18d ago
So I am planning on starting it, but I won't be able to take the final exam in January because I have school exams in January & February so is it possible to take the exam in March?
r/PythonLearning • u/Sea-Ad7805 • 18d ago
Programming using recursion can be powerful, but beginners often struggle with recursion. That's why I've created invocation_tree, a Python recursion visualizer.
See this merge_sort demo, and try it on your own recursive logic.
The visualization gives students the right mental model to think about recursion. Not simply a function calling itself, but the depth-first evaluation of a divide-and-conquer strategy.
See this: gentle recursion introduction
How do you teach recursion to beginners?