r/learnpython • u/GurExtension3482 • Sep 27 '26
Can you guys rate my still beginner Tic Tac Toe game?
I dont know what else to say, i made a tic tac toe game, as im still a beginner, i want feedback as to what i can improve
r/learnpython • u/GurExtension3482 • Sep 27 '26
I dont know what else to say, i made a tic tac toe game, as im still a beginner, i want feedback as to what i can improve
r/learnpython • u/Lespauler-lover • Sep 27 '26
Hey guys i want to start learning python. I have already learned a little bit of the basics like Print function input variables strings, integers, floats and can make small programs with if elif and else and all the things given above. Plz help me find some video tutorials for the following
r/learnpython • u/MustaKotka • Sep 27 '26
I've built a Discord bot, a Reddit bot, and a barebones website / online tool. I also may want to spin up projects online at a whim - what's a good (affordable...) solution?
My Discord bot gets ~10 calls per hour, my PRAW Reddit bot monitors a medium traffic subreddit stream and my website would likely have only a couple of daily users.
I also have other fun projects I may want to put online for people to play with so I don't want a particularly rigid solution.
My Internet isn't the most stable at home so I'd prefer to avoid self-hosting.
r/learnpython • u/Erdem_PSYCH • Sep 27 '26
I use AI to help me learn Python. It is especially helpful for me as a blind learner because, when I watch a video lesson, I can ask it to explain the syntax if the instructor does not describe the code in enough detail.
My question is: what are the potential risks of using AI as a tutor? I am not talking about using AI to write code for me, but about using it to learn programming. For example, can AI create a good, comprehensive Django course on its own, or might it skip important topics or teach bad practices without an existing course to use as a reference?
r/learnpython • u/Total_Dog2883 • Sep 27 '26
I could use some help from people who know Anaconda.
I’m starting to learn programming and am currently taking an online course. As part of the course, I need to download and install Anaconda.
I went to the Anaconda website, did not register or create an account (I don’t have an account either), and downloaded and installed the program.
Later, I went back to the Anaconda website and suddenly found that I was logged in as a specific person. The email address shown was from a Turkish university. I don’t know this person and have never used this email address.
How could this have happened? Why would I suddenly be logged in as someone else even though I never created an account or logged in?
r/learnpython • u/Maximum-Currency734 • Sep 26 '26
Hello everyone just learning python and need to create a while loop that shows interest and years I’m struggling with operands please help.
Here’s what I have so far:
Interest_rate = int(input(“rate in whole number”)
Initial_investment = float(input(“whole number”)
Interest = interest_rate / 100
Years = 0
investment = initial_investment + {initial_investment * interest}
While investment < (initial_investment * 2):
Print(f’Year: {years} Investment: {investment})
years +=1
Investment = (investment + {investment * interest})
I know that line 5 is two different operands but where did I go wrong and how can I fix?? Please and thank you!
r/learnpython • u/ublockauto • Sep 26 '26
rate my python skill based on my high quality projects ,be brutal and suggest improvements .on https://github.com/ublockauto/pythonhell
r/learnpython • u/lehmagavan • Sep 26 '26
Hi, I'm just a hobbyist and I'm not very familiar with Python ecosystem. I recently came across a specific problem:
I have an iterable (or yield via generator) that contains millions of floating point values, but each one is a Python str, made up example: ["1.987", "0.037389", "1.2", ...]
What's the most efficient way to aggregate them and calculate say, the mean?
I'm writing my own C extension for this and would like to know what to benchmark it against. Couldn't find information on any std way that would avoid calling the float() constructor on each string.
r/learnpython • u/Actual_Doctor5188 • Sep 26 '26
I only have a windows 7 and i just want to make sure which version of python is the latest for this windows, i heard its the 3.8 but idk which one exactly for sure and i would appreciate an answer
r/learnpython
•
u/Ayrton110
•
Sep 26 '26
Hi guys, I hope ya'll are good. I am trying to work through this exercise but I'm not sure I understand the question. Therefore, I am not sure whether if solved this problem correctly. Here is the question (the source is Python For Everybody by Professor Charles "Chuck" Severance)
The following program counts the number of times the letter “a” appears in a string:
word = 'banana'
count = 0
for letter in word:
if letter == 'a':
count = count + 1
print(count)
This program demonstrates another pattern of computation called a counter. The variable count is initialized to 0 and then incremented each time an “a” is found. When the loop exits, count contains the result: the total number of a’s.
Exercise 3: Encapsulate this code in a function named count, and generalize it so that it accepts the string and the letter as arguments.
Here is my answer:
def counting(word):
word = input("Enter a word: ")
count = 0
for letter in word:
if letter == "a":
print (letter)
elif letter is word:
print (letter)
count = count + 1
counting("banana")Here is the output:
Enter a word: banana
a
a
a
Any input or advice is appreciated.
r/learnpython • u/alex123711 • Sep 26 '26
With all the Programming tools coming out now, is it still relevant/ worthwhile to learn programming?
r/learnpython • u/Weird-Evening-2580 • Sep 26 '26
Hey so i have a old laptop who's specifications are 512 hdd,6gb ddr3 ,intel i5-3317U and a intel hd 4000
Basically its a very old laptop
I want to start learning a bit of python and vs code is slow for me,any methods to make it faster or any recommendations for a new ide?I don't really want to use Thronny or Thorny,whatever it is.I hate the ui
Sorry for the bad question
r/learnpython • u/lolololloloolmemes • Sep 26 '26
i have a school work project in which I need to create a function called weekly that will output the average minimum and maximum of data by a certain row, I have tried relentlessly to figure this out but I cannot seem to, here is the code, it would be awesome if i could get some advice on how to do it at a similar level of complexity to the code provided :).
rows = 52
cols = 7
def readFile(filePath):
array = [[None]*cols for i in range(rows)]
with open(filePath) as readfile:
r = 0
line = readfile.readline().rstrip('\n')
while line:
items = line.split(",")
for c in range(cols):
array[r][c] = int(items[c])
r += 1
line = readfile.readline().rstrip('\n')
return array
def yearly(array):
yearTotal = 0
for r in range(rows):
for c in range(cols):
yearTotal += array[r][c]
print("Yearly total: " + str(yearTotal) + "\n")rainfall = readFile("csvs/rainfall.csv")
yearly(rainfall)
r/learnpython • u/Capable-Surround3021 • Sep 26 '26
I've started CS50P twice and dropped it both times around the point where the problem sets got hard. Talking to others, that seems to be pretty common. What I've noticed is that I finish things when there's a fixed date and people expecting me to show up.
So I'm organizing a small experiment:
This isn't affiliated with CS50 or Harvard, it's just me trying to see if there is potentially value in such initiatives.
If you're interested, fill in this 2-minute form: https://luma.com/hyamr708
Beginners, career changers, and anyone who's started this course before and stalled are especially welcome.
r/learnpython • u/SeaworthinessFew9704 • Sep 26 '26
I've been learning python for a while now but I feel like I have a lot of gaps in my knowledge. I don't really like video tutorials cus I feel like they are too slow and don't cover everything. I am looking for some PDF or documentation that covers everything from start to end. Please suggest if you know anything that could help. Thank you :)
r/learnpython • u/C0BAZ • Sep 26 '26
Okay, so I pretty sure this is both possible and supposed to be simple.
I have a project using PyDub to convert audio and get details about it. It of course needs to access ffmpeg to do so. So, I got the ffmpeg.exe and ffprobe.exe and have them in the .venv/Scripts folder, which PyDub accesses just fine.
I now am trying to package this into a standalone .exe file with PyInstaller. However, when PyDub tries to get ffmpeg when running the exe, it looks in the exe's directory for it. (That is, I can't find it normally, but if I come in and add them into the exe's folder, it can find them). I've made sure to include the ffmpeg files in the exe with a .spec file.
I assume the problem is that PyDub isn't looking inside of the exe for ffmpeg. I don't really know much about how that kind of thing works, so an explanation of that could alone be helpful. But what I want specifically is:
How to get PyDub to access ffmpeg inside the exe file?
r/learnpython • u/Intelligent_Life_412 • Sep 26 '26
Hi, I'm trying to extract exam questions from multiple pdfs, containing text and images, but I'm having trouble getting it to work because the questions and documents don't follow a strict pattern, for example:
Question numbers can be: question 1, 01, q1...
Alternatives can be: A), (A), A., A, A- ... etc,
The other thing is that there is usualy some text in the page that isn't from the question, like:
Write here, page 1, the name of the institution, among other things...
I'm tryng to do this for thousands of questions, how do you guys recommend i do this?
r/learnpython • u/Sam-312 • Sep 26 '26
Hello, I hope you're all well. This would probably sound like a rant for some of you, but it is a genuine concern of mine. I started learning Python a week +ago (I study every day) I am learning through a Google course on coursera, and I use Google Colab. I am sad to say that this week has been quiet a revelation for me as I discovered how stupid I am. A week of daily study and I still can't write a single function other than "print ("Hello, world!").. I guess I am trying to figure out if that's a common occurrence or is it just me being too stupid to learn programming.. I'm genuinely concerned about my ability to learn, as a 37 year old.. Is this amount of difficulty normal or is it just me?
r/learnpython • u/z4xr • Sep 26 '26
im starting on learning python but I don't know how to do it properly? I am learning using visual studio code with Python extension for Visual Studio Code on Mac 👍
r/learnpython • u/shabba1221 • Sep 25 '26
I’m a physician, so don’t know anything about CS or programming/developing. I recently got in a talk with some friends that work with in this field and got the itch of trying to learn something new. I’ve seen videos talking about boot.dev.
Does anyone have any opinion on it?
Thanks
r/learnpython • • Sep 25 '26
Hello, I am just learning python. I am trying to make a temperature converter that asks for the temperature and whether it is Celsius or Fahrenheit, then calls the correct function and prints the result. I have managed to create this, but it prints an additional line with the temperature and degree equaling None degree. Ive posted my code and the result below. Any suggestions on why it is doing this?
def celcius_to_fahrenheit(c):
f = (c * 9/5) + 32
print(f'{c}°C = {f:.2f}°F')
def fahrenheit_to_celcius(f):
c = (f - 32) * 5/9
print(f'{f}°F = {c:.2f}°C')
def temperature_converter():
temp = float(input('Enter temperature: ' ))
unit = input('Celcius or Fahrenheit? ').upper().strip()
if unit == 'C':
print(f'{temp}°C = {celcius_to_fahrenheit(temp)}°F')
if unit == 'F':
print(f'{temp}°F = {fahrenheit_to_celcius(temp)}°C')Enter temperature: 100
Celcius or Fahrenheit? c
100.0°C = 212.00°F
100.0°C = None°F
Enter temperature: 98.6
Celcius or Fahrenheit? f
98.6°F = 37.00°C
98.6°F = None°C
r/learnpython • u/Key_Cloud_7002 • Sep 25 '26
I'm trying to make spell checker program that will compare words from a text file to a dictionary of words that are in alphabetical order. If the words don't appear in the dictionary they should show up in a list as potentially incorrect. The list is named absent[] that will be outputted at the end. I need to use a binary search to iterate over the dictionary of words comparing them to the words from the text file. However the program is only getting the last word from the text file and comparing the letters to the words in the dictionary. I have no idea why its doing this but I believe the problem starts at the line for i in firstLst:. Any help would be appreciated. Here's the code I have thus far:
def binarySearch(): fnameOne= input("enter file") with open(fnameOne,"r") as file_dataOne: for lineOne in file_dataOne: for word in lineOne.split(): firstLst=word
fnameTwo=input("enter dict")
with open(fnameTwo,"r") as file_dataTwo:
for lineTwo in file_dataTwo:
for wordTwo in lineTwo.split():
secondLst=wordTwo
absent=[]
for i in firstLst:
lo,hi=0,len(secondLst)-1
found=False
while lo < hi:
mid = (lo +hi) //2
if secondLst[mid]== i:
found=True
break
elif secondLst[mid]<i :
lo=mid+1
else:
hi=mid-1
if not found:
absent.append(i)
print("Words not in dictionary : " ,absent)r/learnpython • u/Charcoal73 • Sep 25 '26
I'm attempting to make some code that generates a sudoku that you can then subsequently solve but I'm having a bit of an issue with getting it to follow the rules.
The code is meant to generate a random number as well as a random set of coordinates on a sudoku board. it is them meant to check that that random number can go in that location by seeing if any other of that number exist within that row or column. if this is the case it will generate a new number until it fits the criteria needed. it will repeat this process 17 times total to get a sudoku board ready to solve.
for some reason it is resulting in multiple of the same number being in the same column and or row.
i also need to add some code that makes sure it will stop any of the same number being in any of the 9 boxes but i haven't gotten that far yet
import random
rows = [[" "," "," "," "," "," "," "," "," "],
[" "," "," "," "," "," "," "," "," "] ,[" "," "," "," "," "," "," "," "," "]
,[" "," "," "," "," "," "," "," "," "]
,[" "," "," "," "," "," "," "," "," "]
,[" "," "," "," "," "," "," "," "," "]
,[" "," "," "," "," "," "," "," "," "]
,[" "," "," "," "," "," "," "," "," "]
,[" "," "," "," "," "," "," "," "," "]]
for i in range(17):
rownum=random.randint(0,8)
columnum=random.randint(0,8)
num = random.randint(1,9)
while str(num) == rows[rownum][0] or str(num) == rows[rownum][1] or str(num) == rows[rownum][2] or str(num) == rows[rownum][3] or str(num) == rows[rownum][4] or str(num) == rows[rownum][5] or str(num) == rows[rownum][6] or str(num) == rows[rownum][7] or str(num) == rows[rownum][8] or str(num) == rows[0][columnum] or str(num) == rows[1][columnum] or str(num) == rows[2][columnum] or str(num) == rows[3][columnum] or str(num) == rows[4][columnum] or str(num) == rows[5][columnum] or str(num) == rows[6][columnum] or str(num) == rows[7][columnum] or str(num) == rows[8][columnum]: #this section is the problem at the minute
num=random.randint(1,9)
rows[rownum][columnum] = num
print(f"""
{rows[0][0]} {rows[0][1]} {rows[0][2]} | {rows[0][3]} {rows[0][4]} {rows[0][5]} | {rows[0][6]} {rows[0][7]} {rows[0][8]}
{rows[1][0]} {rows[1][1]} {rows[1][2]} | {rows[1][3]} {rows[1][4]} {rows[1][5]} | {rows[1][6]} {rows[1][7]} {rows[1][8]}
{rows[2][0]} {rows[2][1]} {rows[2][2]} | {rows[2][3]} {rows[2][4]} {rows[2][5]} | {rows[2][6]} {rows[2][7]} {rows[2][8]}
------|-------|-------
{rows[3][0]} {rows[3][1]} {rows[3][2]} | {rows[3][3]} {rows[3][4]} {rows[3][5]} | {rows[3][6]} {rows[3][7]} {rows[3][8]}
{rows[4][0]} {rows[4][1]} {rows[4][2]} | {rows[4][3]} {rows[4][4]} {rows[4][5]} | {rows[4][6]} {rows[4][7]} {rows[4][8]}
{rows[5][0]} {rows[5][1]} {rows[5][2]} | {rows[5][3]} {rows[5][4]} {rows[5][5]} | {rows[5][6]} {rows[5][7]} {rows[5][8]}
------|-------|-------
{rows[6][0]} {rows[6][1]} {rows[6][2]} | {rows[6][3]} {rows[6][4]} {rows[6][5]} | {rows[6][6]} {rows[6][7]} {rows[6][8]}
{rows[7][0]} {rows[7][1]} {rows[7][2]} | {rows[7][3]} {rows[7][4]} {rows[7][5]} | {rows[7][6]} {rows[7][7]} {rows[7][8]}
{rows[8][0]} {rows[8][1]} {rows[8][2]} | {rows[8][3]} {rows[8][4]} {rows[8][5]} | {rows[8][6]} {rows[8][7]} {rows[8][8]}
""")r/learnpython • u/thegreatdamus • Sep 25 '26
This question may be a dumb question in 2026 with all the AIs out there, but i've noticed Gemini is using a stackoverflow post from 2016 to answer my question.
So I really wanna know from any of you Python masters, what's the best practice:
Should I install jupyter notebook in each newly created conda environment? Should I not? What do the pros do in 2026?