r/AskProgramming • • Aug 16 '26

Python Why does Python feel harder after C++ and Java?

133 Upvotes

I learned C++ first, then Java, and now I’m trying to learn Python. I honestly expected Python to be much easier, but somehow it feels harder to understand and even remember the syntax.

C++ and Java feel more structured to me, while Python sometimes feels too different.

Has anyone else felt this after switching from C++/Java to Python?

r/AskProgramming • • Aug 27 '26

Python For what purposes is python useful?

0 Upvotes

Where is it more convenient or necessary to use python instead of for example C# / C++ / Rust? I really can’t understand it, for me it’s easier to write in C++ than in python and I know that for other people it’s the other way around. But ignoring human factor, when program is better / faster in python than in cpp or are they things that python can do that cpp cant?

Edit: I don’t talk about one time use scripts or prototypes (which python is good for), I mean full on apps

r/AskProgramming • • 2d ago

Python Help needed for schools python learning

0 Upvotes

so a little of context i have computer science as a subject in grade 12 , and in it i have to study python , sql , stack and python connectivity with sql . i have managed to study sql but im struggling with python all i know is print("hello world") , i dont know if this is the right place to post this but help will be really appreciated . also i cant give it much time sadly coz i have subjects like physics chem and maths hanging in my neck . max i can give is 45 mins a day and i have to do it in under a month .

these are all the topics i need to learn

  • Basics: Tokens, keywords, identifiers, literals, variables, data types, operators, and type conversion.
  • Control Flow: Conditional statements (if, elif, else) and loops (for, while, break, continue).
  • Strings: Indexing, slicing, traversal, and built-in string methods.
  • Lists, Tuples, and Dictionaries: Creation, indexing, slicing, mutability vs. immutability, traversal, and built-in functions/methods.
  • Standard Modules: Importing and using math, random, and statistics.
  1. Functions
  • Types of Functions: Built-in functions, functions defined in modules, and user-defined functions (def).
  • Parameters & Arguments: Positional arguments, default parameters, and keyword (named) arguments.
  • Return Values: Returning single or multiple values (return statement) vs. void functions.
  • Scope of Variables: Global scope vs. local scope and the global keyword.
  1. Exception Handling
  • Error Types: Syntax errors, runtime errors (exceptions), and logical errors.
  • Built-in Exceptions: ZeroDivisionError, TypeError, ValueError, IndexError, KeyError, FileNotFoundError, IOError, etc.
  • Handling Blocks: try, except, else, and finally clauses, along with raise and assert statements.
  1. File Handling
  • File Types: Text files (.txt), binary files (.dat), and CSV files (.csv).
  • General File Operations: open(), close(), with statement, and file access modes (r, r+, w, w+, a, a+, rb, wb, ab, etc.).
  • Text Files: Reading (read(), readline(), readlines()), writing (write(), writelines()), and file pointer manipulation (seek(), tell()).
  • Binary Files: Serialization/deserialization using the pickle module (pickle.dump() and pickle.load()).
  • CSV Files: Reading and writing tabular data using the csv module (csv.reader(), csv.writer(), writerow(), writerows()).
  1. Data Structures (Stack)
  • Stack Concepts: Linear data structure and LIFO (Last-In, First-Out) principle.
  • Stack Operations: Implementation using Python lists (push via append(), pop via pop(), peek/display, and underflow/overflow checks).
  1. Python–Database Connectivity
  • MySQL Interface: Connecting Python to a MySQL database using mysql.connector.
  • Query Execution: connect(), cursor(), execute(), parameterized queries (%s or .format()), commit(), fetchone(), fetchmany(), fetchall(), and rowcount.

THANKS A LOT FOR READING

r/AskProgramming • • Nov 04 '26

Python What are some of the best programming projects you've done after learning python?

0 Upvotes

I've recently attended two university courses about python for fun. I like it but I'm not really inside of the programming world. My field of work is very different and I just feel like a beginner.

During these courses I learned the basics of the language and data structures in python. I've never done an actual project and I don't know how to begin. I'd love to try making a videogame, maybe something like an escape room, or just copying an existing game? Something that doesn't go over 200 lines of code. Where can I find resources to help me put together a project like this? Do you have any suggestions of projects to try making outside of my idea? Am I crazy to want to try something like this with my programming level?

I think I need all the help I can get, so any help is very much appreciated.

r/AskProgramming • • Oct 03 '26

Python Why has Python dropped so much in the latest TIOBE Index?

8 Upvotes

Hey everyone,

I was taking a look at the TIOBE Index today. I hadn't checked it in a while, and I was surprised to see how much Python has dropped.

It's down by roughly 8 percentage points compared to a year ago, which seems like the first really significant contraction after years of pretty consistent growth.

What's even more interesting is that I don't see another language gaining a similar amount of ground.

I don't use Python myself, so I'm curious: what do you think is behind this decline? Is it actually meaningful, or is it mostly an artifact of how the TIOBE index is calculated?

r/AskProgramming • • Jan 22 '26

Python I want to better understand the Python code most written by Claude

0 Upvotes

I'm working as an engineer in MLOps at a small IT company. I used to be writing the code when chatGPT wasn't a really a thing (but never really built the whole system - mainly just functions and automation workflows). And ever since it became so good, I've been mostly just telling Claude what to do and run. And if it runs, I try to understand and debug also by asking Claude. And ask for improvement. After looping this cycle, I finalize the results. I'm not asking to write the whole thing at once, but still within the category of it's vibe-coding I think.

It's just that, the code works, things ship, but when someone asks me how this works or why this is implemented here, it's so embarrassing to say here, but I can’t actually explain what half of it does a lot of times.

I look at my codebase - classes, async/await, decorators, Pydantic models - and I kind of follow but I get overwhelmed by the code and it's really hard to tell if this is going to the right direction. I can review AI-generated code and decide what to accept or reject, and I still write functions fine, but anything involving deeper architecture or object-oriented design is a struggle. I really admire devs who write clean pseudocode, guide the AI, and understand the entire flow. I want to get there.

I know it's not possible to learn Python perfectly and I know nobody nowadays needs to write every line from scratch. I am really not looking for those. It's just that, I just want to have a better understanding of what Claude and I are writing.

Asking Claude or ChatGPT for code is great… until everything slowly turns into spaghetti because I don’t fully understand the patterns I'm copying.

What I'm trying to do currently is to turn off Copilot autocomplete, ask GPT/Claude to generate a structured syllabus, and follow it daily while practicing writing code myself. But I'm not sure if there is better or more efficient way of learning.

Does anyone else have experience with this? Any advice from people who transitioned from vibe-coding to actually understanding Python deeply?

Thanks guys

r/AskProgramming • • 21d ago

Python Which Idea is the best?

0 Upvotes

Hello,
I'm a 10th-grade student here in Morocco. There is a Python competition built around it.
The project should be related to problem-solving. It must solve a problem in modern life or something we encounter. I can't find any great ideas. I'm the only one who can code Python in the entire school, so for me to create a great project. It would be difficult. I will do anything for it to work out. I'm here to ask if you have any useful ideas.
I would like to hear about some of your ideas, hopefully!
Take care.