r/PythonLearning • • 9h ago

Terminal Based Turn Based RPG beginner project

13 Upvotes

Very new to python. This is my first semi-large project.

In the video above, I show the admittedly amateurish code, and a demonstration. I demonstrate the WARRIOR and MAGE class to show basic and magic abilities in action.

A text based turn based RPG game which runs in the terminal. Commands like attack or defend must be typed manually and as they are displayed in the GUI to avoid type errors. So far there are 4 classes(one of the classes is not functional at the moment) with the ability to create a custom class. When creating a custom class the player gets 26 skill points to distribute across the different skills.

Skills include: Strength, Defense, Evasion, Critical Hit Damage, Agility, Spirit, Mana, Luck. The flow of the game is largely determined by these skills with some RNG mixed in.

Spells and Abilities are assigned to the player at the start of the game depending on the stats selected. Magic focused characters are assigned magic abilities while, damage/agility focused characters are assigned normal abilities. For magic assignment, the change of obtaining any particular skill is determined by the value of [(0.0-0.9)*Player spirit stat)] + a base obtain value. Ability assignment works in the same way but used the players ability stat to determine obtain chance.

Evasion skill determines the chance the player will dodge an enemy attack. Both the player and enemy have this skill.

An enemy is generated in the beginning game with the players stats in mind. This is done to ensure fairness.

To determine the value of the enemy attack value, I created a formula to dynamically assign a value based on the disparity between the player and enemy health stat. The equation is as follows...

A = \sqrt{100-[(\frac{P}{M}})\cdot 100]

or...

C = (Player_Health/Monster_Health) * 100

B = 100 - C

A = sqrt(B)

There is no party system in this game, which limits strategy. The enemy turn functions through an AI which is still a work in progress. I say AI, but no neural network is used, instead, the enemy learns which actions will yield positive results based on the player follow up action. The probability of an action being repeated is increased or decreased based on how detrimental/beneficial that follow up is.

No AI was used to create this. Again, I am a very amateur programmer and understand that there lots of things i can do to improve this, like utilizing object oriented programming, or less dependence on global variables, .json files, naming consistency like: statsPlayer, Player_Stats, stats. Please give suggestions of ideas for what I should add. I am actively learning while making this project and implemented a lot of these things would require to me to rewrite everything. I would rather finish what I have and create a new and improved version with these fixes.

Please give your feedback and ideas for what I should add. Currently I am in the process of completed the Magic buff and Ability buff system as not all buffs currently work, finishing the ITEM system, finishing enemy AI(as of now, all the enemy can do is use light attacks and dodge), adding a dungeon mode alongside current single mode, and adding a shop to buy items after obtaining gold in dungeon mode.

Dungeon mode would allow you to collect XP and level up as you defeat enemies, forcing you to fight stronger enemies as you grow stronger, until you reach a dungeon boss which uses unorthodox mechanics which the player will have to figure out to win. The player will be rewarded gold after each victory which can then be used at the shop.

Some additional notes: When creating your own class, naming your character "DEBUG" will enter you into debug mode, which allows you to change the LUCK stat to artificially increase RNG values. Otherwise, the LUCK stat is assigned a value randomly. When on battle menu, typing help will give a brief overview of the GUI and how to navigate it. When on the abilities screen, typing the ability name followed by the "--d" or "--description" tag will show the description of selected ability.

as of now only the "--d" tag is available, but I want to program in different tags for debug and quality of life purposes. Any ideas on what kinds of tags I should include?


r/PythonLearning • • 9h ago

Online classes for US teen?

8 Upvotes

My 13 year old wants to learn python next. Are there any online classes you all recommend?


r/PythonLearning • • 1h ago

guys is anyone who can carry for become a python devloper??

1 Upvotes

Hey I am second year college student doing B.tech . And i literally got frustrated what shoudl i learn although I know python but i don't know what to learn next , so please can someone carry me side by side , so that i can i want a guideance just like teacher so that i can get a internship this year as soon as possible .. please help ..


r/PythonLearning • • 8h ago

Showcase I built a free interactive Python learning platform

2 Upvotes

Hello everyone, I’ve been working on runtime.school for a while, and after receiving feedback from multiple users, I’ve made quite a few changes to make learning and practicing Python easier.

The platform has interactive lessons, coding challenges, practice questions, projects, and datasets. Everything runs directly in your browser, so there’s nothing to install or set up.

I’ve also improved the learning experience to make it more beginner-friendly and easier to progress from one concept to another.

SQL is already available on the platform, and I’m planning to add PySpark next week.

If you’re currently learning Python or getting back into it after a while, give it a try. It’s free to use.

https://www.runtime.school/python

Feel free to share it with anyone who’s learning Python. I’d love to hear your feedback, especially if there’s anything that needs to be changed, improved, or added.


r/PythonLearning • • 14h ago

Teammates in learning

2 Upvotes

Hey, I'm learning python for like a month. Just wondering if anyone could join me to make some projects together not super completed things.


r/PythonLearning • • 15h ago

Coding my first "big project" in Python

1 Upvotes

Hello everyone,

These months I have been coding a bigger program than the last one. Inside I put real options of what you can enter and I have used all that I have learned from the tutorial. Now that I have "finished" for now, I will continue upgrading it.

The program is based on a menu that allows you to access different options. Once the program starts, it greets you and asks which option you want to choose. There are a total of 3 options (only 2 work, it's all explained in the README file on GitHub), the statistics option asks you questions of how your imaginary match being a goalkeeper has been going, the videogame one plays a game where you have to guess a number between 1 and 100, giving you clues to find it and the exit option stops the program.
Here I will put the URL with all the project, any constructive criticism is welcome and appreciated.

URL: https://github.com/danigabarror2011-cpu/proyecto-python

Note: All the text of the program is in my native language, Spanish.


r/PythonLearning • • 15h ago

Showcase I am 15 and this is my game

0 Upvotes

Title: I built a survival game in Pygame where your own movement history hunts you down (Cursor Chase)

Hey everyone!

As a 15-year-old developer, I wanted to share a project I’ve been working on called Cursor Chase. It's a fast-paced survival game built entirely with Python and Pygame where your own past actions become your biggest enemy.

🎮 The Concept

The core mechanic is simple: every movement you make is recorded.

A delayed cursor clone follows the exact path you took moments before. As time passes, the delay shrinks, forcing you to move smarter, trap yourself less, and constantly outrun your own ghost. If you touch the clone, run into an "irritation zone" hazard, or clip a wall, it’s game over.

🛠️ Key Features

* Async Self-Multiplayer: You are essentially racing against your own historical movements.

* Progressive Difficulty: The chaser's delay decreases over time, turning the endgame into a high-intensity survival sprint.

* Procedural Elements: Dynamic maze walls and hazard spawning keep every run unique.

* Score Loop: Combines your survival time with coin collection bonuses.

🚀 Check It Out

The project is open-source, so feel free to check out the code, run it locally, or contribute!

* GitHub Repository: https://github.com/coding-arnav66/Cursor-Chase

Quick Setup:

```bash

git clone https://github.com/coding-arnav66/Cursor-Chase.git

pip install pygame

python cursor_chase.py


r/PythonLearning • • 1d ago

Help Request I only have a android phone how should I learn python im 13 can someone help me to learn it or just teach me?

12 Upvotes

r/PythonLearning • • 1d ago

Beginner Qs - easy project?

9 Upvotes

what’s the easiest (but impressive sounding) Python project? I
am gonna be honest I need to larp, I want to mention a simple but honest project that I coded in my personal statement for uni (applying for maths and CS) where I want to sort of prove I’ve independently taken up Python learning

help me larp comp geniuses


r/PythonLearning • • 1d ago

Discussion Where do you use None in python

14 Upvotes

So far I've only really used None in two places:

  1. With dict.get(), when the key isn't there.
  2. With del in classes. I set a variable to None so the object gets cleaned up.

Where else do you use it? Do you use it as a default value for function arguments, or for missing data?

 

I'm curious how people use it in real projects.


r/PythonLearning • • 1d ago

I built my first MCP server on Claude! Now AI agents can create and deploy websites 🤖

Thumbnail claude.ai
0 Upvotes

I've been experimenting with MCP and AI agents, and I finally got my first project working!

I built AgenTack, an MCP server that allows AI agents like Claude to do something beyond generating code: actually create a website, upload its files, and publish it online.

Here's the interesting part:

Instead of asking an AI to generate HTML and then manually figuring out hosting and deployment, you can give your AI agent the tools to do the whole process.

What I've got working so far:

  • Create websites through an AI agent
  • Upload and manage website files
  • Deploy and publish websites
  • Manage multiple websites through MCP

I've tested the integration with Claude, and seeing an AI agent actually publish a website was a pretty exciting first milestone. 😂

But I'm curious about something:

Are we moving toward a world where developers won't need to touch hosting and deployment at all, because their AI agents will handle it?

Or is MCP still more hype than practical value?

I'd genuinely love to hear what other developers think. Especially if you've built something with MCP.

You can find it on Claude: Agentack

This is my first MCP project, so feedback (including criticism) is very welcome!


r/PythonLearning • • 2d ago

Complete beginner - Where should I actually start with Python?

9 Upvotes

Hi everyone, I'm a complete beginner with zero coding experience.

I want to learn Python to build small projects in the future.

I checked the FAQ and tried a few YouTube videos, but I feel overwhelmed because there are too many courses and I don't know which one to stick to.

For someone like me who knows nothing, what is the ONE course / book / path you recommend to start with and finish?

Thanks!


r/PythonLearning • • 2d ago

Learning Python Feels Easy. Until It Isn’t.

Thumbnail
youtu.be
28 Upvotes

Explore many more ArjanCodes videos.


r/PythonLearning • • 2d ago

Help me collect handwritten digits for a Deep Learning project!

6 Upvotes

Hey everyone!

I'm currently working on a Deep Learning project, and I need your help with something simple: collecting handwritten digits!

I built a small web app where anyone can write digits (0–9) using their mouse, trackpad, or touchscreen and submit them to contribute to my dataset.

The goal is to collect handwritten samples from different people, with different handwriting styles, so I can train and experiment with a digit recognition model.

How to participate:

  1. Open the website: https://malak-meliani.github.io/digits-by-hand/
  2. Write a few digits (0–9).
  3. Submit your samples!

It only takes a minute or two, and every contribution helps, even if you only submit a handful of digits.

I'd really appreciate it if you could give it a try! And if you have any feedback or suggestions about the website, I'd be happy to hear them.

Thank you so much to everyone who takes the time to contribute! ❤️


r/PythonLearning • • 2d ago

Complete beginner - Where should I actually start with Python?

0 Upvotes

​

Hi everyone, I'm a complete beginner with zero coding experience.

I want to learn Python to build small projects in the future.

I checked the FAQ and tried a few YouTube videos, but I feel overwhelmed because there are too many courses and I don't know which one to stick to.

For someone like me who knows nothing, what is the ONE course / book / path you recommend to start with and finish?

Thanks!


r/PythonLearning • • 2d ago

Help Request Python Under the Hood by David Vael

1 Upvotes

Hey everyone,

Everyone writes x = 10. Few look at the PyLongObject in memory. Don't just play the standard deck-be the Joker of Poker. 🃏🐍

Python Under the Hood by David Vael


r/PythonLearning • • 2d ago

Python Friendgroup/Server

11 Upvotes

i'm a 20 year old CS student learning python, I feel like theres many other people like me so I felt like making a community where everyone helps each other would prosper us. My discord is filiph20 if u feel like joining just add me :)


r/PythonLearning • • 2d ago

Help Request Collections cheatsheet

5 Upvotes

Hi guys! Can you share your favorite cheatsheets for collections module? I'm trying to find one with asymptotics, but everything that I can find either doesn't contain them, or has limited set of functions and methods


r/PythonLearning • • 2d ago

Neural Network built from scratch with NumPy

Post image
8 Upvotes

This 👉interactive 𝐦𝐞𝐦𝐨𝐫𝐲_𝐠𝐫𝐚𝐩𝐡 demo visualizes 1,000 training steps of a neural network learning to solve the XOR problem. Watch how the weights evolve as the network learns.

Use the "Step Into" button to explore the implementation in neural_net.py and see the details of the forward and back-propagation. Follow the mathematics behind the implementation in 📑this PDF.

No PyTorch or TensorFlow — just Python, NumPy and mathematics.

Explore 👉other 𝐦𝐞𝐦𝐨𝐫𝐲_𝐠𝐫𝐚𝐩𝐡 visualizations.


r/PythonLearning • • 2d ago

Help Request How can I improve?

Post image
1 Upvotes

r/PythonLearning • • 2d ago

Help Request Help needed for schools python learning

2 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/PythonLearning • • 2d ago

Help Request Need Help With My Selenium Spotify Playlist Scraper

4 Upvotes

Hello, I am attempting to make a spotify playlist scraper. The html reading and everything else is working correctly but the automatic scrolling is not fully working yet and I am stuck. For some reason when i get to about the 100 song mark, Spotify refuses to load any more songs for me. I have tried waiting it out, scrolling a bit more to hopefully trigger it to load, and adding some fake clicks to try to trigger spotify to load. I dont know why it is doing this because when I manually use page down to scroll on a seperate browser it works perfectly. Here is a video of what is happening, and I have linked my github repo for you guys to take a look at it because I cannot post both a video and an image.

HERE


r/PythonLearning • • 3d ago

Help Request Taking the Certiport Python ITS exam in a few days

5 Upvotes

Hey everyone, I’m a high school student taking the Certiport ITS Python exam in a couple of days, and I need a 700 to pass.
I already have little Python knowledge, so I’m mostly looking for resources tailored to the actual exam format and tricky questions. Are there any specific YouTube video, or practice tests that helped you pass? Any last-minute tips on what topics they test heaviest would be super appreciated!


r/PythonLearning • • 3d ago

Showcase My first "authenticator"

Thumbnail
gallery
54 Upvotes

Two months ago I started learning python, but not regularly, and today I made my first mini "authenticator", just because I wanted to understand how JSON works.
I used AI to debug some things, because I started with an authenticator without json saves, then I found out about JSON(and combining them was difficult), but most of it was typed by me. Take a look at my code and share your thoughts on how I used JSON and conditionals.

P.S. I know somethings are pretty basic or not the most secure, but as I said, it's just to understand how JSON and conditionals work in this kind of program.