-
def main():
-
-
months = ["January","Feburary","March","April","May","June","July","August","September","October","November","December"]
-
-
SIZE = 12
-
rainForMonth = [] * SIZE
-
index,subNumHigh,subNumLow = 0,0,0
-
yearTotal, yearAverage, monthHighest, monthLowest = 0.0,0.0,0.0,0.0
-
-
for index in range(SIZE):
-
print "Enter the amount of rainfall for the month of", months[index]
-
rainForMonth = float(raw_input(("Enter here: "))
-
-
yearTotal = arraySum(rainForMonth,SIZE)
-
yearAverage = yearTotal / SIZE
-
monthHighest, subNumHigh = arrayHighestValue(rainForMonth,SIZE)
-
monthLowest, subNumLow = arrayLowestValue(rainForMonth,SIZE)
-
-
print "Here are the results!"
-
print "Amount of rainfull for the year:", yearTotal
-
print "Average rainfall for the year:", yearAverage
-
print monthHighest, "had the most rainfall."
-
print monthLowest, "had the least rainfall."
-
The problem is with line 14. I try to run the program and it highlights the totalYear variable in line 14 saying that it is an invalid syntax. Nothing looks wrong to me.
Update****
Just had to fix my parenthesis in line 12.
Error is not necessarily there though. You have unmatching brackets on line 12.
1 2615
Error is not necessarily there though. You have unmatching brackets on line 12.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Andreas Neudecker |
last post by:
Hello.
I am relatively new to Python and I have a strange problem with some
code. In a class the __call__ method gets parameters like this:
class WhatsUp:
__call__ (
self,
var1,
|
by: Petr Prikryl |
last post by:
Hi,
Summary: In my opinion, the C-like prefix
increment and decrement operators (++i and --i)
should be marked as "syntax error".
Current situation: try... (Python 2.4 (#60, ...))
>>> i =...
|
by: Bradley Kite |
last post by:
Hi all.
I'm trying to diagnose/solve a problem with internet explorer, whereby
sometimes the form submits, and other times IE produces an 'invalid
syntax' error.
First, I have a form, and...
|
by: Mark Phanides |
last post by:
My ASP.NET application intermittantly (but always at same point) redirects to the 'Invalid Syntax Error' web page for some unknown reason.
I've created a ASP.NET application written in VB.NET with...
|
by: DIBS |
last post by:
I'm new to Python and I don't understand what I'm doing wrong.
I'm running windows xp.
In the command line window, I type:
Python Sudoku.py
and I get the response"
SyntaxError: invalid...
|
by: py |
last post by:
Hi,
I am running python 2.4.2 on win xp pro. I have the WMI module from
Tim Golden (http://tgolden.sc.sabren.com/python/wmi.html).
I have some code which does this...
MyScript.py...
|
by: Sheldon |
last post by:
Hi Everyone,
I am new here but I am pretty good at python programming but I am not
exert. I have been away from programming for about a year and now I am
programming in python again in...
|
by: ronrsr |
last post by:
no matter where I place this imported file,the statement after it in
the main program gets a syntax error, regardless of the syntax.
I think I may have changed something in this file, but I'm...
|
by: jonathanemil |
last post by:
Hello,
I am a 1st semester Computer Science student in a Python class. Our current assignment calls for us to read a list from a file, create a 2-dimensional list from the file, and check to see...
|
by: kakarot vegeta |
last post by:
There 's an invalid syntax error but i don't know what's wrong with it.
the error says
Invalid syntax: print variation_string
import itertools
variations = itertools.product('ab',...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |