I am trying to calculate numerical integration for each different StepSize.So I used this operator StepSize_list.append(StepSize)

` `
```f = lambda x: 3 * x ** 2 + 2 * x

variable_list = []

initial_value = 1.0
final_value = 3.0
Actual_value = 34

StepSize_list = []

for StepSize in range(50, 250, 50):

StepSize_list.append(StepSize)

def Integral(L1, L2, STEP):
delta_value = (L2 - L1) / STEP
count = 0; Int = 0
variable_list = []

for k in range(STEP):
count = count + delta_value
variable_list.append(count)

for k in range(len(variable_list) - 1):
Int = Int + delta_value * ((f(L1 + variable_list[k]) + f(L1 + variable_list[k + 1])) /2)

return Int

Calc_value = Integral(initial_value, final_value,StepSize)
Error = (abs(Actual_value - Calc_value) / Actual_value) * 100

print('Int Result is {} with {} percent Error'.format(Calc_value, Error))```

and then I encountered this error:

` TypeError: unsupported operand type(s) for /: 'float' and 'list'`

Nov 17, 2020 in Python 10,565 views

Hi, @Amisek,

Python doesn’t support arithmetic operation (/,*,+,-) on lists. The operators + and * are list operations.

## TypeError: unsupported operand type(s) for -: 'list' and 'int'

Hey, @William For me the code is working ...READ MORE

+1 vote

## TypeError: unsupported operand type(s) for /: 'list' and 'list'

This is my part of code, why ...READ MORE

## TypeError: unsupported operand type(s) for -: 'str' and 'str'

& is "bitwise and" operand in Python, you ...READ MORE

## TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

Hi guys i have below code . ...READ MORE

## TypeError: unsupported operand type(s) for *: 'CommentedMap' and 'CommentedMap' Hatam bu nasıl çözebilirim ?

from ruamel import yaml from scipy import spatial import ...READ MORE

## Test Failed: unsupported operand type(s) for -: 'tuple' and 'list'

Hi, @There, Check what are you passing.. the ...READ MORE

## how can i randomly select items from a list?

You can also use the random library's ...READ MORE

+1 vote

## how can i count the items in a list?

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