Skip to content

Smallest Number Function

Trying to make a simple function that determines the smallest number in a list of numbers. For some reason, it looks like my for loop is only executing once for some reason with this function. What am I missing? Answer Your return statement is in your for loop. Remove the last indent of your return, and it sh…

Discord.py read list

I have a file with a list called wbanned.txt which contains forbidden words. I want every message sent to be read and if it contains one of the forbidden words in the txt list (Every word is on a new line from list) to be deleted. I tried something but all it does is delete it only if it contains

Cant decode HTTP Response to JSON (Python3)

I am running a series of API tests and this one is giving me an error. As far as I can tell response.read() converts the HTTP response into binary and then decode() converts that binary into a string but it’s an empty string. When I copy paste the binary string into Python3 (b'{“error”: {&#8…

Why Matplotlib.hist taking different list?

I’m trying to plot the following And getting This one actually draws a different array([ 1., 4., 5., 8., 9., 10., 10., 10., 10., 10.], which is created run time automatically. Answer I assume you mean the red histogram appears to be wrong? It’s not. You’ve got cumulative=True so it adds each…

Working outside of application context Flask JWT decorator issue

I am fairly new to Flask applications. While my application works for all the endpoints as expected when I tried to add jwt authorization I encountered this issue. I have tried this solution app.app_context().push() based on some other questions that have been posted. Any help would be greatly appreciated. I …