Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9228465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:19:49+00:00 2026-06-18T05:19:49+00:00

im currently working on a simple text adventure in python. basically i want the

  • 0

im currently working on a simple text adventure in python. basically i want the randint to choose 1 or 2 then assign to right_wire, then raw_input to be wire_choice, then the 2 are matched to deliver the desired outcome. Im sure you guys can figure out what im trying to do here anyway. am i close here or really way off? Thanks!

    right_wire = randint(1, 2)

    wrong_wire = 0

    if right_wire == 1:
        wrong_wire = 2
    elif right_wire == 2:
        wrong_wire = 1
    else:
        print "ERROR"

    while True:
        print "Which wire do you pull?"
        print
        print "1. The red one."
        print "2. The blue one."
        print
        wire_choice = raw_input('*>>*')

        if wire_choice == 1 and right_wire == 1:
            print "**BOMB DEFUSED**"
            return 'engineering2'
        elif wire_choice == 2 and right_wire == 2:
            print "**BOMB DEFUSED**"
            return 'engineering2'
        elif wire_choice == 1 and right_wire == 2:
            print "**FAILED**"
            return 'death'
        elif wire_choice == 2 and right_wire ==1:
            print "**FAILED**"
            return 'death'
        else:
            print no_understand
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T05:19:50+00:00Added an answer on June 18, 2026 at 5:19 am

    Python is a “strongly typed” language. It doesn’t turn text (a string) into a number (an int) automatically. It doesn’t turn the number randint(0, 1) into a boolean either. But you can tell it to make conversions such as str(right_write) or int(wire_choice).

    Converting a number to a boolean is a little different. Python objects have a method nonzero which Python calls when needed, implicitly, to determine whether the object is to be considered false or true. And booleans are subclass of int, so they have integer values. You still have the option to convert explicitly as bool(randint(0, 1)) or by using an expression like randint(0, 1) == 0.

    I haven’t explained exactly how to code your solution because I feel certain that you can take it from there and because you can make your own choice of how you prefer to express your code.

    P.S. I’d like to link to more information about the special case of the boolean value of non-boolean objects. In particular, Python specifically permits us to test the truth value of non-booleans. And we are advised to do so, or at least, Google’s guide recommends testing the truth value of non-booleans.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on a programming assignment for school. It's a simple text-based RPG.
I am currently working on a simple form and i want the info to
I'm currently working on this really simple text based game and to play again,
I'm currently working on a simple php function for an entity in the framework
I'm currently working on a simple web application where users each have their own
I am currently working on a simple Silverlight app that will allow people to
I am currently working on some simple custom allocators in c++ which generally works
I am currently working on a simple web application through Google App engine using
I`m currently working out the design for simple graphic editor, who support trivial operations
I'm currently working on a reasonably simple MVC app which allows the user to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.