I can't find what I did wrong.
def program(a, b, c):
a = eval(input('Enter value a: '))
b = eval(input('Enter value b: '))
c = eval(input('Enter value c: '))
my_list = list(range(a, b+1))
if a>b:
print('0')
else:
def power(my_list):
return[ x**c for x in my_list ]
my_list = x**c
print(sum(power(my_list)))
A couple of things...
For starters, please give thread titles a descriptive title regarding the problem.
Then explain what you want the result of your code to be, and what is the actual result you get. If you get errors post full error traceback message in error tags.
Also the indentation in your code. Blocks are indented by 4 spaces.
Then there are plenty of bad approaches and illogical orders, but we will get to that later.
So first... fix indentation, explain the desired result and actual result, prefereably with exact code you used to test it.
a=0
b=0
c=0
def program(a, b, c):
a = eval(input('Enter value a: '))
b = eval(input('Enter value b: '))
c = eval(input('Enter value c: '))
my_list = list(range(a, b+1))
if a>b:
print('0')
else:
def power(my_list):
return[ x**c for x in my_list ]
my_list = x**c
print(sum(power(my_list)))
program(a,b,c)
Is my_list = x**c
supposed to execute? Because it never will as the code is written.