Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Pyton code

  • 03-04-2014 06:58PM
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 Posts: 2,011 ✭✭✭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, Registered Users 2 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