Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

ParthKohli

  • 3 years ago

Are you awesome?

  • This Question is Closed
  1. ParthKohli
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I am trying to build a webpage for this: ``` import random print("Are you awesome?") randomnum = randrange(1,10) name = input("What is your first name?") if (len(str(name)) == int(randomnum)): print("Yes!") else: print("Nope...") ```

  2. ParthKohli
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I have had this so far (don't care about the poor design for now): ``` <!DOCTYPE html> <head> <link href=' http://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'> <style> body { background-color:#c0c0c0; } span { position:fixed; top: 50%; left: 50%; width:30em; height:18em; margin-top: -9em; /*set to a negative number 1/2 of your height*/ margin-left: -15em; /*set to a negative number 1/2 of your width*/ background-color: #c0c0c0; font-family:'Ubuntu'; } </style> <input type = "text" value = "Enter your first name." id = "nameFirst"> <div id = "output" style = "position:fixed; length = 9px; width = 9px;">...</div> <script type = "text/javascript"> var randomnumber= Math.floor(Math.random()*11); var name = prompt("What is your first name?"); var boole = (name.length() == randomnumber); function awesomeness() { if boole == true { document.getElementbyId("output").innerHTML = "Yes!"; } else { document.getElementbyId("output").innerHTML = "Nope..."; } } </script> <input type = "button" onClick = "awesomeness()"> <title>Are you awesome?</title> </head> <body> <span><h2>Are you awesome?</h2></span> </body> </html> ``` Does anyone know why it doesn't work?

  3. ParthKohli
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I know I am a newbie. ='(

  4. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy