Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
I made a Mastermind like game

Hi

This is my first code ever so please be kind. I just finished some online tutorial and wanted to test what I remembered from it. Thank you in advance for your time.

#game mastermind
#code breaking game

#X = not in phrase
#O = in phrase and in the right place
#A = in phrase but at the wrong place

import random

print('Mastermind !')

maxnumber=input('Input your maximum number between 4 and 9 (9 being the hardest) : ')

phrase = [random.randint(1,int(maxnumber))]
for x in range(3):
a = random.randint(1,int(maxnumber))
while a in phrase:
a = random.randint(1,int(maxnumber))
phrase.append(a)

playerphrase= 0000
counter = 0

maxcounter=input('How many turns do you want to give yourself (3 is not doable 4 is hard and it gets easier

/r/Python
https://redd.it/k1fmq5