Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 16-11-2009
Member
 
Join Date: Oct 2009
Posts: 67
Python syntax error

Hey guys
I am have an syntax error in my python code. I am trying to make a problem on slope intercept equations. This is my first block and I already have problems. When I run the program I get a window saying "there is an error in your program". My code is follows.
Code:
def SIform ():
    x(1) = input('enter the x value of the first point: ');
    y(1) = input('enter the y value of the first point: ')
    #those numbers are the first point i.e. (x,y)
    x(2) = input('enter the x value of the second point: ')
    y(2) = input('enter the y value of the second point: ')
    #these numbers are the second point i.e. (x,y)
    M = (y(2) - y(1)) / (x(2) - x(1))
Reply With Quote
  #2  
Old 16-11-2009
Member
 
Join Date: May 2008
Posts: 2,293
Re: Python syntax error

Hi
I is a long time I have coded in python. However, I think your code contains semi-colons, I believe that semi-colon may be your problem. I have only needed to use that when using C++. This is just as a suggestion because when I coded I had some problems by trying to do this myself. Make sure that all of the variables are floating points because of that you will not be able to divide properly and you will only get the integer version. This may be your problem check it out.
Reply With Quote
  #3  
Old 16-11-2009
Member
 
Join Date: Oct 2009
Posts: 67
Re: Python syntax error

Hi,
Thanks for replying back.
Actually I never had any problem with the variables. The code had nothing to do with the variables. I works now after having it print what m equals. By the thanks again for replying. And surely I will post back in future if I have any problems.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Python syntax error"
Thread Thread Starter Forum Replies Last Post
JScript compilation error syntax error B.Prajapati Technology & Internet 4 14-02-2011 03:24 AM
Getting Error "invalid syntax" in Python kyosang Software Development 5 29-01-2010 10:53 PM
What is a syntax error? Chrisch Software Development 3 24-11-2009 09:53 AM
PHP WordPress Parse Error: syntax error, unexpected $end in Bisujaksha Software Development 2 22-05-2009 09:27 AM
DOS commands, Syntax Error softte Operating Systems 3 17-02-2009 03:08 PM


All times are GMT +5.5. The time now is 08:10 AM.