473,386 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to fix syntax error message?

Hi,

I apologize if this seems like a silly question, but I am a new user of python, never programmed before. I am writing a simple program and I get an "invalid syntax" message concerning this line of code:
[monthlySales=float(monthlySales)]

when I try to run the program the only message I am given is this exactly:
"There's an error in your program, invalid syntax"

the word [monthlySales] at the beginning of that line of code is highlighted pink.

This is for an assignment, and try as I might, I just cannot figure it out on my own...

Any help or insight would be greatly appreciated!!

Thanks
Ashley
Jan 22 '11 #1
1 3751
bvdet
2,851 Expert Mod 2GB
Ashley,

That is invalid syntax. You cannot make an assignment inside brackets. Example:
Expand|Select|Wrap|Line Numbers
  1. >>> N = 23
  2. >>> [N = float(N)]
  3. Traceback (  File "<interactive input>", line 1
  4.     [N = float(N)]
  5.        ^
  6. SyntaxError: invalid syntax
  7. >>> N = float(N)
  8. >>> N
  9. 23.0
  10. >>> 
Jan 23 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Fred Gravel | last post by:
I have a Windows app that I have installed on 3 client machines (all win2k) thatreturn an un-handled error message when starting up. I have placed 'Try/Catch/Finally' blocks in the 'sub main' and...
1
by: Dan | last post by:
I can't figure out this error message. Could someone please help. I have a text file in Notepad with the following 4 fields (Cont, Code, List, and Numb)all of which are single tab delimited, and a...
2
by: c676228 | last post by:
Hi, I have several user controls like email, phone,ssn etc. each has it's own validation message in its user control already. When I bring all those user controls in an aspx page, I would like to...
1
by: Allerdyce.John | last post by:
I need some help in reading error message: which line has problem? line 233? or line 37? Thank you. $ ./read2.py log.xml Traceback (most recent call last): File "./read2.py", line 233, in ?...
4
by: leaf0209 | last post by:
Hi, I am new to this forum and have been troubled by this problem for the past few days. I would appreciate if someone would take a look and help me out. I am using vb express 2005 edition... ...
1
by: William Cruz | last post by:
Can anyone help me with this piece of code. - I keep on getting the error message "The object exporter specified was not found" If i change it to run on my local machine it works fine, the...
2
by: Lalit | last post by:
Hi I am executing following commands. True ------------working fine but for below statement it is giving syntax error. SyntaxError: invalid syntax any idea what is incorrect in my syntax
4
by: sigkill9 | last post by:
I'm trying to create a script that will accept a user entered integer and find only one set of prime numbers that add up to that integer but need some help. The script is supposed to only accept...
1
by: puer_apuliae | last post by:
- Federation Server (DB2) - Solaris 10 Fed Server db2 "create user mapping for USER123 server SRV1 options (remote_authid ‘AAA_USER’, remote_password ‘PWD’)" CLP response: # ./db2...
1
by: inbarik | last post by:
Hi, i'm getting syntax error message for this button that tries to get name (of building) with apostrophe. Any idea how to solve this? Note that i must use name with apostrophe e.g. O'neal: ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
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
0
BarryA
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
Oralloy
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,...
0
jinu1996
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.