[Tutor] Can't find my syntax error

Israel Evans israel@lith.com
Wed, 20 Jun 2001 13:51:51 -0700


I'm kind of new to this but I think that you are declaring a type for i
which isn't nesecary in Python.  In a sense, you've declared two variables
here.  One name int and one name i.

Take out the int and see what happens

-----Original Message-----
From: DavidCraig@PIA.CA.GOV [mailto:DavidCraig@PIA.CA.GOV]
Sent: Wednesday, June 20, 2001 1:46 PM
To: tutor@python.org
Subject: [Tutor] Can't find my syntax error


I have been working my way through the examples on "How to Think Like A
Computer Scientist (Python)".  I can't seem to find my error.  Help
Please!! I'm sure its simple, I just can't see it.  Thanks!

Dave


##PrintMultiplicationTable function with new parameter

def printMultiples(n, high):
    int i = 1
        while i <= high:
            print n*i,   '\t',
            i = i + 1
        print

def printMultTable(high):
    int i = 1
        while i <= high:
            printMultiples(i, high)
            i = i + 1

And gets me the following:

Python 2.1 (#15, Apr 16 2001, 18:25:49) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
IDLE 0.8 -- press F1 for help
>>>
  File "C:/Python21/Practice/printMultiplesn.py", line 4
    int i = 1
        ^
SyntaxError: invalid syntax


D. H. Craig, CSM



_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor