Thread: New to Python

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

    Join Date
    Nov 2012
    Posts
    21
    Rep Power
    0

    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.

    Code:
    def tax(bill):
        bill *=1.08
        print (bill)
        return bill
    Thanks for looking,
    Nicki
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,997
    Rep Power
    481
    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