[Tutor] Re: import probs

jason hochstein bigapple631 at optonline.net
Fri Aug 13 21:33:10 CEST 2004


this is the error I get.

>> Welcome to the age program.
This program will determine whether you are a child, adult, legal to drink beer or a senior citizen.
Congratulations, you're old enough to drink.
 Thank you for trying this product. Please come again.
Traceback (most recent call last):
  File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript
    exec codeObject in __main__.__dict__
  File "C:\Documents and Settings\Jason\My Documents\Touro Docs\python documents\Assignments\AGE.py", line 24, in ?
    exit = input ()
  File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\app.py", line 368, in Win32Input
    return eval(raw_input(prompt))
  File "<string>", line 0
     
     ^
 SyntaxError: unexpected EOF while parsing
>>> 
  ----- Original Message ----- 
  From: jason hochstein 
  To: tutor at python.org 
  Sent: Friday, August 13, 2004 3:30 PM
  Subject: import probs


  I am trying to figure out why my I can't get one module to import to the other. Here is what I have.

  print "Welcome to the age program."
  print "This program will determine whether you are a child, adult, legal to drink beer or a senior citizen."
  age = input("How old are you? ")
  if age < (18):

      print "Congratulations, your a kid."

  elif age == (19 or 20):
      
      print "Congratulations, you're an adult."

  elif age >= (21) and age < (65):
      print "Congratulations, you're old enough to drink."

  elif age > (65):
      print "Congratulations, you're a senior citizen. You get a discount for being old."


  import add

  print " Thank you for trying this product. Please come again."


  exit = input ()
      

  here is what the import add is: 

  def add():
      print "Your age divided by 2 is", age / 2
      print "Your age times 10 is", age * 10
      print "I hope this works. "

  They are both in the same directory on my c drive as well.
  It wont import it.??
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20040813/bed954dd/attachment.htm


More information about the Tutor mailing list