P
PeterSo
I am just starting to learn Python, and I like to use the editor
instead of the interactive shell. So I wrote the following little
program in IDLE
# calculating the mean
data1=[49, 66, 24, 98, 37, 64, 98, 27, 56, 93, 68, 78, 22, 25, 11]
def mean(data):
return sum(data)/len(data)
mean(data1)
There is no syntax highlighting and when I ran it F5, I got the
following in the shell window.
Any ideas?
If I added print mean(data1), it gave me a invalid syntax
# calculating the mean
data1=[49, 66, 24, 98, 37, 64, 98, 27, 56, 93, 68, 78, 22, 25, 11]
data2=[1,2,3,4,5]
def mean(data):
return sum(data)/len(data)
mean(data1)
print mean(data1)
instead of the interactive shell. So I wrote the following little
program in IDLE
# calculating the mean
data1=[49, 66, 24, 98, 37, 64, 98, 27, 56, 93, 68, 78, 22, 25, 11]
def mean(data):
return sum(data)/len(data)
mean(data1)
There is no syntax highlighting and when I ran it F5, I got the
following in the shell window.
Any ideas?
If I added print mean(data1), it gave me a invalid syntax
# calculating the mean
data1=[49, 66, 24, 98, 37, 64, 98, 27, 56, 93, 68, 78, 22, 25, 11]
data2=[1,2,3,4,5]
def mean(data):
return sum(data)/len(data)
mean(data1)
print mean(data1)