Skip to content

Tag: function

Perform an exception for a list of funtions

hello people (I am new to python) Question: i use ipywidgets with buttons, i want to call a list of function, sometimes there’s a problem in a function (syntax, division by zero,…), i try to put an exception to pass the error and lunch the next function, don’t work :( I’m running in ju…

Pygame functions having two brackets

Why does pygame.dispay.set_mode(()) and other similar functions has two braces instead of one and why it isnt working if i just put only one brace? Answer The display mode gets a tuple with two items to describe the resolution for the render-screen. And a tuple will be defined by When using the default you ju…

Plotting graph from data frame

Plotting the graph for both South Asia and Eastern Asia using the above function is showing the same countries and same graphs .What mistake am I doing while writing the above code, I can’t figure that out? enter image description here Answer The problem is with your function. Remove the for loop and it…

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…