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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:33:45+00:00 2026-06-06T22:33:45+00:00

Ok so I am making a roulette game. The random number that the spinner

  • 0

Ok so I am making a roulette game. The random number that the spinner lands on is called ‘figure’. It is a very basic and simple code but it won’t seem to work for me properly.
At the moment you either pick a specific number or choose 1 – 18. I’ve tried many different ways and still no luck. Here is my code. If anyone knows what the problem is please let me know. Thanks:

numbers = ['1', '2', '3'.......'35', '36']

figure = choice(numbers)

d = textinput("Pick bet", "")

if int(figure) > 18 and d == '1-18' or '1 - 18' or '1- 18' or '1 -18':
    pu()
    goto(100,100)
    write("Loser", font = ("Comic Sans MS", 30, "bold"))

elif int(figure) < 19 and d == '1-18' or '1 - 18' or '1- 18' or '1 -18':
    pu()
    goto(10,100)
    write("Well done", font = ("Comic Sans MS", 30, "bold"))


elif int(d) in range(36) and int(figure) == int(d):
    pu()
    goto(100,100)
    write("Well done", font = ("Comic Sans MS", 30, "bold"))

elif int(d) in range(36) and int(figure) != int(d):
    pu()
    goto(100,100)
    write("Loser", font = ("Comic Sans MS", 30, "bold"))
  • 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-06T22:33:47+00:00Added an answer on June 6, 2026 at 10:33 pm

    Look at:

    if int(figure) > 18 and d == '1-18' or '1 - 18' or '1- 18' or '1 -18':
    

    Here you have several statements that always evaluate to True; each of '1 - 18' or '1- 18' or '1 -18' is a a non-empty string. It doesn’t matter what values int(figure) or d have. This means python sees that line as the equivalent of if something or True.

    What you want to do instead is use the in operator to test if your d is part of a list of options:

    if int(figure) > 18 and d in ('1-18', '1 - 18', '1- 18', '1 -18'):
    

    The same problem applies to your elif statement.

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

Sidebar

Related Questions

I am making a text based russian roulette game in Python, but I am
Making game of life I need to a have a grid that is 30x20
Im making a game in Java with a few other people but we are
Making a simple map app, plan on adding buttons to mark specific locations But
Making a very basic paint program for a class and one of the requirements
Making a ship game because I am incredibly original.. With that aside, I have
Making a simple Java code for Blackjack and need some advice. OK I am
Making UI programmatically is very powerful. But is there a way I would have
Making a new site but something is happening to it in IE8. The social
Making a new site but something is happening to it in IE. I've purchased

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.