r/learnpython • • Feb 12 '24

Day 2 of learning python. I made the most complicated code I could that counts to 10

2 Upvotes
counter = 0

while counter < 5:

 counter += 1

 print(counter)

if counter < 5:

 function = True

if True:

  print(6)

if True:

  dex = 5

while dex < 6:

  dex += 1

  print(7)

if dex <= 6:

  print(8)

if dex <= 6:

  hp = 5

while hp > 4:

  hp -= 1

  print(9)

if hp >= 4:

  fax = 10

if fax != counter:

  print(10)

r/learnpython • • Jul 29 '24

What if i can not learn python fluently or learn to suffer

0 Upvotes

Nowadays I’m learning python backend django but i getting suffer. What can i do ?


r/learnpython • • Aug 23 '24

why -1 // 6 is -1 in python? It is 0 in C++ and Java

2 Upvotes

and 1 // -6.


r/learnpython • • Dec 24 '24

How to run a .exe daily?

0 Upvotes

Hello, all! Recently I have forgotten to fill my clock in in my job, so that I came up with the idea of developing a automatic clock-in/clock-out system in Python which is not that hard. I could use the Task Scheduler, however, I do not want to donwload Pycharm or any IDE on my company's device. The solution I have is to convert .py to a .exe, but how could I use Windows Task Scheduler with a .exe considering the code must have images to work?


r/learnpython • • Dec 20 '24

Hey how did you learn?

0 Upvotes

I found a 100 days course udemy , that’s seems to be doing good so far, I’m wondering how I should learn python?


r/learnpython • • Dec 25 '24

Amateur Teenage coder

0 Upvotes

Hey guys I really want to learn to code and I have been following all these python books and I am having trouble what do you guys suggest I do?


r/learnpython • • Jul 18 '22

‘Best’ IDE?

2 Upvotes

I’ve been coding for about a year, and when I first got into it my friends told me that VS Code was the best IDE, so that’s the one I installed and have been using since.

However now I’m actually dedicating more time to learning python, and have seen people mentioning IDE’s like Pycharm. So I’m still wondering if VS Code is actually the ‘best’ IDE.

So, which IDE would you guys recommend?


r/learnpython • • Sep 15 '24

How to extrat int from string like "123ABC" or "ABC123EFG"?

22 Upvotes

int() does not work and I don't want to read each digit one by one and then join them


r/learnpython • • Sep 08 '24

How can i start learning Python?

15 Upvotes

Hi! Im still young and looking towards learning Python! Im still in school and in the week i dont have much time but on the weekends i can be on my PC for almost 11 hours! What website should i look at to learn python? Is it easy for beginners? I never programmed before, is it beginner friendly? Can i make advanced programs?

This is everything for now! Im happy to know!


r/learnpython • • Jan 19 '23

So Python's having a stroke and it's saying 3.3 - 2.2 = 1.0999999999999996 instead of 1.1

181 Upvotes

The problem is that 3.3 - 2.2 = 2.2 - 1.1 = 1.1 in real life, but Python is not accepting this reality.

It says that 3.3 - 2.2 equal to 1.0999999999999996 instead of 1.1.

I've even tried the version with parentheses in, I've restarted my computer, I've tried other computers too but it displays the same results. Can someone explain to me what is going on? The link below is my screenshot.

I'm using Python 3.11.0 on Windows 10 (if it helps).

https://freeimage.host/i/HcH3yue

Edit: It wasn't the first time I've seen the floating point error in Python. So now I have a post for an issue that I was aware of before, already knew how to make workarounds for it, and there are just random comments and upvotes I made at 1pm. It's 4:19am and I'm awake, and I see this.

maybe I was really tired when I made the post.

But really, thank you for all of the resources, people of r/Python. It'll be very useful when I have to explain this to my friends who are struggling to learn Python.


r/learnpython • • Mar 04 '25

How do I master for loops?

0 Upvotes

I’ve been stuck on this for months. I know what they are, how they work, how to read them, etc. I even spent the day learning the structure, and I review all of this frequently. I at least understand these things on a surface level. I’m basically going in circles at this point. But, I still can’t write them. When I practice with practice problems I get stuck for hours if not days, and even though I try, I still end up way off. What am I missing/doing wrong/not doing enough of?

Example exercises:

  1. Calculate sum of all numbers from 1 to a given number

  2. Find the sum of a series up to n terms

  3. Print all prime numbers within a range


r/learnpython • • Nov 26 '23

Which Python is tailored to Artificial Intelligence?

0 Upvotes

I am planning to pursue a bachelor's degree in Artificial Intelligence, and it requires a solid foundation of python. which specific part of python should I focus on for my journey?

I am planning to pursue a bachelor's degree in Artificial Intelligence, and it requires a solid foundation in Python. which specific part of Python should I focus on for my journey?


r/learnpython • • Apr 25 '23

I’ve been programming for 6 months and need guidance

3 Upvotes

So basically I’ve been coding for about six months and the only language that I have started is python. I have created a program that is almost finished it automatically creates workout programs for me at the click of a button in after entering a few personal pieces of information(current lifts, age bodyweight).

My older brother just started his career and coding as a data analyst it was recommending that I should start using sql and Kaggle after he took a look at my code.

My end goal is to build rockets and help program a lot of the robots/ai that will be used on it.

My short term goal is to start making a program that automatically withdraws money from a my bank account and trades stocks using machine learning to progressively get better at it.

I’ve installed tensor flow, PyTorch, pandas, scipy, and many more libraries to help me out. I’ve taken a couple of Udemy’s longest python courses and frequent stack overflow.

I would like to be able to get live data and log it into charts that I can create through python libraries.

How should I go about this? I’m willing to take any ideas/criticism on career routes, project ideas, best methods to practices and learn

Edit/TL;DR :

I want to build rockets, code/create robots, and create help create the software that makes the use of said goals easier. How do I go about this?


r/learnpython • • May 03 '25

What is the best device to start learning python?

0 Upvotes

Since I m going to start my python learning journey, I wanted know in which device I can start it efficiently..


r/learnpython • • Oct 05 '26

My plan on how to learn python (rate my plan)

0 Upvotes

Just a little context before I start I have never coded a line of code in my life. So I was recently sent over a python course on YouTube by Programming with Mosh and I’m super excited on how to finally learn python. The course itself is about six hours, so I’m probably gonna try and break it down by watching half of the video today and then half of the video tomorrow. Honestly, I feel like the best way to really learn this language is just to watch the video straight through and not take notes or practice what is being taught in the video so that my full retention is on the video itself. After doing that I’m probably gonna try and watch another YouTube tutorial on Python to see how well my comprehension was on the first YouTube tutorial. Does this sound like a good plan?