# I need help with a small game

from random import randint

guessesTaken = 0
randomNumber =

for x in range(4):
tempNumber = randint(1, 9)
randomNumber.append(tempNumber)

def gus():
global Guess
Guess =
Guess.append(int(input("Guess Number: ")))
Guess.append(int(input("Guess Number: ")))
Guess.append(int(input("Guess Number: ")))
Guess.append(int(input("Guess Number: ")))
print(Guess)
guessesTaken =+ 1
randow()

print (randomNumber)

def randow():
check =
if randomNumber == Guess:
print(“Y”)
check.append(‘Y’)
else:
print(‘N’)
if randomNumber == Guess:
print(“Y”)
check.append(‘Y’)
else:
print(‘N’)
if randomNumber == Guess:
print(“Y”)
check.append(‘Y’)
else:
print(‘N’)
if randomNumber == Guess:
print(“Y”)
check.append(‘Y’)
else:
print(‘N’)

if check == False:
if check == ‘Y’:
if check == ‘Y’:
if check == ‘Y’:
if check == ‘Y’:
print(‘You are a mastermind’)
print(guessesTaken)

else:
gus()

gus()

this is giving me trouble because i cant print ‘You are a mastermind’ and how many guesses were taken

Something that can help you is moving your code to a Markdown code block. See this example:

`````````
```
``````

Also, take care of the indentation!

You wrote:

``````if check == False:
if check == 'Y':
if check == 'Y':
if check == 'Y':
if check == 'Y':
print('You are a mastermind')
print(guessesTaken)
``````

Then:

[…]
this is giving me trouble because i cant print ‘You are a mastermind’
and how many guesses were taken

Doesn’t `if check == False` imply that the other things can never be
true? i.e. you’re only looking for lots of `Y`s when you know there are
not any.

1: Drop the `if check == False`, see what happens.

2: Better to write: `if not check` for that test (but as I remark, I
think that test is breaking things for you).

3: You should really pass a lot of this stuff around as function
parameters instead of globals. Tackle that later.

Cheers,
Cameron Simpson cs@cskk.id.au

it’s all indented, it posted it all on one side for some reason.

i am a bit confused because im still new to python. can you give me an example or give me sites where i can figure this out on my own.

That’s where a code block will help you (see my comment above).