Sigma code look like this but it s not working

0 votes
def sigma(lowerBound, upperBound):
    x = list(range(lowerBound, upperBound))
    print(str(pow(Id,i) /factorial(n)*pow(Mu,i)))

 My sigma code look like this but it’s not working
My value is tuple

Nov 15, 2020 in Python by Rajiv
• 8,880 points

1 answer to this question.

0 votes

Use Markdown to style code:

- Use a single backtick (`) at the beginning and end of your single code line:
  print("hello world")
- Use three backticks (```) at the beginning and end of multiple code lines:
  def hello(name):
      print(f"hello {name}")

Thinking about how sigma works

You need an initial sum.

You then want a way to add the expression with each succession. As Sato said, a for loop would be good for this - going from the range of lower to upper bound

With each iteration of the loop add the result of the expression to the current sum

answered Nov 15, 2020 by Gitika
• 65,870 points

Related Questions In Python

+2 votes
0 answers
0 votes
1 answer
0 votes
0 answers

I am trying to click the button but it is not working and it is drop list ..

<a class="quickreports btn btn3d tbbtn" href="javascript:" style="position:static" ...READ MORE

Dec 1, 2019 in Python by anonymous
• 120 points
0 votes
0 answers

But when I run this, I get NameError: name 'alphabeta' is not defined error. How to solve this?

tree = [[[5, 1, 2], [8, -8, ...READ MORE

Sep 5, 2020 in Python by MUHAMMAD
• 160 points

retagged Sep 7, 2020 by Gitika 160 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,833 views
0 votes
0 answers
+4 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,810 points
0 votes
1 answer
0 votes
1 answer

I've been trying to run this code, but the error says "Expected an indented block" for the line, " word_as_list[index] = guess."

Hi, @Paradox, The error message IndentationError: expected an indented ...READ MORE

answered Nov 20, 2020 in Python by anonymous
• 65,870 points