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 7590701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:28:14+00:00 2026-05-30T20:28:14+00:00

I am making a text based russian roulette game in Python, but I am

  • 0

I am making a text based russian roulette game in Python, but I am not nearly finished, as one can see just by looking at my code:

#!/usr/bin/env python
print("The maximum number of bullets is 3")
bulletcounter = input("How many bullets do you want your gun to have?")
print(bulletcounter, "bullets")
paname = input("Enter Player 1's Name: ")
pbname = input("Enter Player 2's Name: ")
print(paname.capitalize(), "Vs.", pbname.capitalize())
if bulletcounter == 1:
    bulletcount = 0
    print(bulletcount)
    bulletaloc = random.randint(1, 6)
    while bulletaloc != bulletcount:
        bulletcount += 1

For some reason, even if someone enters 1 into bulletcounter, it doesn’t trigger the if statement: if bulletcounter == 1. How do I make it trigger the if statement?

  • 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-05-30T20:28:15+00:00Added an answer on May 30, 2026 at 8:28 pm

    Use raw_input for your paname and pbname variables. Be sure to import random at the top of your file. It would also be better to use int(raw_input("How many...")) for bulletcounter, too, I think, than input, since this can be used to evaluate any arbitrary python code.

    Also, it would be worth checking to see which version of Python you are using, when you invoke it using the env command. If, at the command line, you run:

    /usr/bin/env python -V
    

    and are getting “Python 2.x.y” instead of Python 3, and you are expecting to be using Python 3, consider changing that first line to call your Python 3 interpreter instead. The recommendations noted above assume you are using Python 2.

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

Sidebar

Related Questions

I'm making a text-based game, and I just finished the majority of code, and
I am making a text based game in Java. I have a text field,
I've been on and off intrested in making a text based browser game. I
I am currently making this text-based rpg game with a simple GUI. I was
Alright let me explain myself here: I am making an online text based game.
Okay, so I'm making an online text-based game, and I'm stuck right now with
I'm making a python text adventure. It is based off of ex41 in Learn
I'm following a tutorial on C# on making a text-based game and I ran
I'm making a game and in the menu I want to display the text
I'm making a user control, and I manually draw the text string, but I

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.