|
| |||||||||
| Tags: python programming language, syntax |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| 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)) |
|
#2
| ||||
| ||||
| 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. |
|
#3
| |||
| |||
| 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. |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Python syntax error" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 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 10:27 AM |
| Download Python 3.0 / Python 3000 | Amaresh | Software Development | 6 | 24-02-2009 09:28 AM |
| Ldif Syntax Error | John5 | Windows Software | 0 | 31-05-2007 10:14 PM |