Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mastermind game in python
#6
When you input() from the console, it always comes in as text. So even if the user is typing "3451", you'll get that as a string. So using strings of digits is identical to using strings of letters. Other than changing the colorcode list to have digits, there shouldn't be anything much to do.

If you had an integer for some reason, just convert it to a string and handle it as above.
Reply


Messages In This Thread
Mastermind game in python - by veronwltan - Jun-16-2021, 05:02 PM
RE: Mastermind game in python - by bowlofred - Jun-16-2021, 05:05 PM
RE: Mastermind game in python - by veronwltan - Jun-16-2021, 05:35 PM
RE: Mastermind game in python - by proebba - Mar-22-2023, 12:03 PM
RE: Mastermind game in python - by proebba - Mar-22-2023, 11:48 AM
RE: Mastermind game in python - by bowlofred - Mar-22-2023, 08:09 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020