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’ve got a sequence a(n)=(5-77sin(n)+8n^2)/(1-4n^2) and I’m trying to find a candidate for the limit of this sequence. How do I do this? I’ve tried using a code below but that didn’t work so any ideas?enter image description here
As discussed here, for sympy you need to use ** for raising to a power and not ^.
This will work:
from sympy import limit, sin, Symbol, oo
from sympy.abc import x ,n
r = limit((5-77*sin(n)+8*n**2)/(1-4*n**2),n , oo)
r
Adaptation of OP code based on:
https://docs.sympy.org/latest/modules/abc.html
https://docs.sympy.org/latest/modules/series/series.html
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 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.
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.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
How can i generate all possible polynomials for coefficients of 1..10 and a degree of 10 ?
preferably in Python or ruby .
I have found PythonPoly module , but still dont understand how to make it .
Thanks .
Seems like you want somebody to do your homework for you .
But here you go ...
my_polynomials = itertools.product(range(1, 11), repeat=10)
Then :
for p in my_polynomials:
do_something_with_polynomial(p)
This is a Ruby versioin
my_polynomials = (1..10).to_a.repeated_combination(10)
To print the first 50:
my_polynomials.take(50).each{|mp| p mp}