Thread: New to Python

  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Rep Power

    New to Python

    Hi this code is in version 2.7 Python and I need it for version 3.2. Any ideas what I need to change to make it work?
    Please only post if you can help, Ive just had to deal with someone in another forum who just couldn't get his head around the fact that a complete beginner might not know this.

    def tax(bill):
        bill *=1.08
        print (bill)
        return bill
    Thanks for looking,
  2. #2
  3. Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Aug 2011
    Rep Power
    Looks like valid python3 code to me. Critical issue is that in python3 print became a function whereas it had been a statement. Thus you need the parentheses denoting print function call.
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo