5.2 Step 11 There appears to an error in the example code

There appears to be an error in the example code for averages.
I can not figure out what the issue is. I am basing the code that I am entering on this example so I am not able to complete my code.
“Traceback (most recent call last):
File “python”, line 7
sum_of_numbers +=number
^
SyntaxError: invalid character in identifier”

Hi Amber. There isn’t an error in the code (I’ve double-checked it by running in a code editor). However, if you’ve copy/pasted the code into a repl.it, it’s possible that some of the formatting was messed up in the copy/paste. Remember, Python is sensitive to whitespace. This means sometimes copy/paste operations can break syntax due to the differences in the ways editors handle whitespace.

the code is giving me an error as well… this is what is on the screen:

Editor:
def calculate_interest(principal):
temp = round(1 + .08 / 12, 3) # the comma and then 3 indicates we want 3 decimal places
comp_rate = round(temp ** 12, 3) # ditto
print(“Interest rate divided by 12, added to 1:”, str(temp))
print(“Previous result raised to power of 12:”, str(comp_rate))
total_amount = principal * comp_rate
return total_amount

Shell:

Python 3.6.1 (default, Dec 2015, 13:05:11)
[GCC 4.8.2] on linux

Repl.it: Stopping… please wait

Repl.it: Stopping… please wait

Repl.it: Stopped

Repl.it: Stopped

Here is the code syntax below. Don’t forget the header then the body, where statement(s) are in the body. 4 indention’s are the way to go.

The syntax for a function definition is:
def name( parameters ):
||||statements

I used bars as spaces |||| here just to illustrate their placement.

thank you, I’ll try that.

I am getting the same error message as well. below is the code that I have typed:
numbers = [80,90,70,100,70,100]
number_of_items = len(numbers)
sum_of_numbers = 0
sum_of_numbers += numbers
average = sum_of_numbers / number_items
print(average)

please help! what am I doing wrong?

Looks like you need to establish a loop to pass through the items in the numbers list?

perhaps. . . "for number in numbers: ", to get started?

Ok, thanks. I will give that a try.

for number in numbers:
sum_of_numbers += numbers

Just add that in there and you should be good.