Is there a Python 2 equivalent of Javascripts confirm() command? -


short version question.

longer version: learning javascript via codecademy, while trying relearn python 2 @ same time. finished choose own adventure story.

in code below, can figure out how adjust python 2 besides code except confirm command in line 2.

// check if user ready play! confirm("it's gametime!"); var age = prompt("what's age"); if (age < 13) { console.log("you're young, go play"); } else {     console.log("you're old enough. start playing"); } console.log("you @ justin bieber concert, , hear lyric 'lace shoes off, start racing.'"); console.log("suddenly, bieber stops , says, 'who wants race me?'"); var useranswer = prompt("do want race bieber on stage?"); if (useranswer === "yes") {     console.log("you , bieber start racing. it's neck , neck! win shoelace!"); } else {     console.log("oh no! bieber shakes head , sings 'i set pace, can race without pacing.'"); } var feedback = prompt("rate game 1-10"); if (feedback > 8) {     console.log("thank you! should race @ next concert!"); } else {     console.log("i'll keep practicing coding , racing."); }  

i'd appreciate help. many thanks.

if you're attempting capture input user @ command line use raw_input function:

age = raw_input("what's age?\n") 

Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -