Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Pyton code

Options
  • 03-04-2014 7:58pm
    #1
    Registered Users Posts: 63 ✭✭


    Hi all could some one change this code from python to HTML please.:) I get a compilation error the way it is.
    [code}
    {o = 0
    m = 0
    y = 0
    x = 0
    str_n = input(" Enter the number of coins N in the chest ")
    num_n = int(str_n)
    x = num_n % 3
    num_n = num_n - 3
    num_n = num_n / 3
    y = num_n
    m = num_n + 1
    o = num_n + 2

    if x > 0:
    print "-1"
    input("Press Enter to esc")

    else:
    print (str(o) + " " + str(m) + " " + str(y))
    input("Press Enter to esc")}
    [/code]


Comments

  • Registered Users Posts: 2,031 ✭✭✭colm_c


    You can't convert Python to HTML period.

    Python is a programming language
    HTML is a markup language

    You could convert it to HTML and Javascript, or you could convert it to a server-side python application which generates HTML and the python does the logic.

    What are you trying to learn/achieve?

    You need to make a stab at it yourself, no-one is going to do your homework for you!


  • Registered Users Posts: 63 ✭✭Emmet Manning 99


    I already worked out the code from a problem we were given in python but can't get it to work in HTML.


Advertisement