473,382 Members | 1,389 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,382 software developers and data experts.

Can't Assign to literal Error Message

Hi this is Bits here
My Question is When i try to run my prog.it is giving an exception.

i.e can't assign to Literal.Could you tell me why?

the error msg is:
Syntax Error :Can't Assign to literal


the code is :
Expand|Select|Wrap|Line Numbers
  1. x=50,x=2
  2. def Funct(x):
  3.     print'the values of x is:',x
  4.  
  5.  
  6.     print 'Now the value of x is:',x
  7.  
  8.  
  9.  
  10. Funct(x)
  11. print'The value of x is same as the First one :',x
Jul 13 '10 #1
1 6450
bvdet
2,851 Expert Mod 2GB
The interpreter is trying to assign a tuple to x.

Do this instead:
Expand|Select|Wrap|Line Numbers
  1. x=50, 2
or
Expand|Select|Wrap|Line Numbers
  1. x=50
  2. x=2
Expand|Select|Wrap|Line Numbers
  1. >>> x=5,x=2
  2. Traceback (SyntaxError: can't assign to literal
  3. >>> 
  4. >>> x=50,2
  5. >>> x
  6. (50, 2)
  7. >>> 
Jul 13 '10 #2

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

Similar topics

6
by: Mikie | last post by:
This worked once. I can't get the error message to show on the screen in IE6. It briefly flashes at the bottom of the screen. I have turned on the show message under options. I do have popup...
2
by: Andrew | last post by:
Hi there, I migrate ASP to Win2003, and the error page doesn't display the errors but a general error like "The page cannot display..." when error displays, and the error doesn't occur in...
5
by: jose luis fernandez diaz | last post by:
Hi, In the program below: #include <stdio.h> #include <stdlib.h> #include <errno.h> using namespace std; int main()
0
by: Ron James | last post by:
When loading an XmlSchemaCollection with a corrupted .XSD file I get an XmlSchemaException thrown with a helpful Message such as "The following text is not allowed in this context: XXX. An error...
1
by: PocketDeveloper | last post by:
When trying to consume a Web Service on my website from a Pocket PC device, the Pocket PC app throws this error (I replaced my website name, for security, in this newsgroup message): "An...
2
by: DaVinci | last post by:
linux debian 2.6.16 how can I send the error message to the user by email? such as void sendmail(char* errormsg ,char* email) { } how can I implements the function?
3
by: florian.boldt | last post by:
Hi, is it possible to relate a Java SQL exception (for example: SQL Editor - bad syntax in a user's sql statement) to the corresponding db2 error message in a java application? Does it depend...
1
by: anonymisiert85 | last post by:
I run this string to produce a error "x+1" PyRun_SimpleStringFlags() return -1, so that i know this is a script with error inside... but now - how can i get error message? i tested some...
2
by: bruce24444 | last post by:
I have a field in a table set to "Required". When a user is inputting data via a form and if they leave this field blank, Access automatically returns the following error message: The field...
5
by: =?Utf-8?B?a2F0?= | last post by:
Account: 'pop.griffincreek.net (3)', Server: 'pop.griffincreek.net', Protocol: POP3, Server Response: '-ERR Invalid command.', Port: 110, Secure(SSL): No, Server Error: 0x800CCC90, Error Number:...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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 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.