Indenting issue

Hi all,

First of all here is the link to my project:

Second of all it is the #17 which is causing me trouble.

Thirdly, here is a snapshot of my code:

Blockquote: “”"
Number Guess: A game that gets you guessing the outcome of a dice roll. Who wins? AI or you? Let’s find out!


from random import randint
from time import sleep
def get_user_guess():
guess = int(raw_input('Guess a number: '))
return guess

def roll_dice(number_of_sides):
first_roll = randint(1, number_of_sides)
second_roll = randint(1, number_of_sides)
max_val = number_of_slides * 2
print “The maximum possible value is %d” % max_val
guess = get_user_guess()
if guess > max_val:
return “No guessing higher than the maximum value!!!”


For some reason - "roll_dice(6), although it is not indented, it is causing me that error and I am unsure how to fix this issue.

If you have any comments on how to resolve this rather annoying issue (of all the things that I could struggle with…), I would be most thankful! Much love bros.

Your roll dice signature line is indented so that it looks like it is in the function body of the one above it.


It says its not defined… I dont think it is indented.

It is indented in your first screen grab. The signature line is the one with def in it.

Must have resolved that issue for another one. Do you know how i could define it?

you are correct! It was and I was too blind to see it. Thanks for your help!

1 Like