Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I am getting this error.. code not submitting
need help thanks in advance
I believe your error is in finding the midpoint.
In python, if we use len(lst)/2 it will return float value.
The Index of list cannot be a floating point value.
Change your line to:
midpoint = len(lst)//2
This will return an Integer value as output.
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed last year.
Improve this question
import Wikipedia
result = Wikipedia("India", sentences = 2)
print(result)
It gives me an error. Please can you resolve this error?
import wikipedia
result = wikipedia.summary("India", sentences = 2)
print(result)
#use Wikipedia in small case and use summary
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
The problem he faced is briefly. I need to write a function that calculates the factorial. This function must calculate the factorial of the numbers I send (of more than one number). After calculating the factorial of the numbers I sent him, he should add them all and send them back to me. I do both separately, but I cannot do it together. I leave the link of the codes.
https://pastebin.ubuntu.com/p/dRJnMT7fkt/
enter image description here
Maybe you can use this:
def Faktoriyel(a):
sonuc=0
for f in a:
sonucumuz=1
for i in range(1,f+1):
sonucumuz *= i
sonuc += sonucumuz
return sonuc
Here you go as you requested one function.
If it helps you please upvote and accept the answer.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I want to select the rows where the revenue is NaN. So, row 7 and row 43 should be selected. I tried the code (In[117]) shown in the screenshot but it doesn't work for me.
You can use isna
NaN_table[NaN_table.Revenue.isna()]
Just use isnull:
NaN_table[NaN_table['Revenue'].isnull()]
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
i want to cut all the columns of Data Frame. When I print the result it show good result, but when I want to assign those values in new data frame it returns NaNs.example of code
You need to paste your code here for understanding proper solution of problem.
you can try to add one line of code:
slc=slc.reset_index(drop=True)
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
I am trying to create a random order generator. I have a list of ten names and want to write a program that returns the same list in a random order.
Here is my code which I'm told has invalid syntax in line 11
.
I am trying to complete the problem using filtering and recursion to further my understanding of these tools.
random.shuffle() is what you are looking for.