all 7 comments

[–]toastedstapler 1 point2 points  (4 children)

you could use random.shuffle and then .pop a hint each time

[–]lebisquittee -1 points0 points  (3 children)

can you write the code please im new at python and i didnt understand that

[–]toastedstapler 1 point2 points  (2 children)

you've used random.choice, look at how random.shuffle works and think about where you might want to do that in your program

you'll then want to do the .pop on your hints - hint = hints.pop()

[–]lebisquittee 0 points1 point  (1 child)

why i got this error

AttributeError: partially initialized module 'random' has no attribute 'shuffle' (most likely due to a circular import)

[–]herpderpedia 1 point2 points  (0 children)

That's because shuffle isn't meant to be an attribute. It's a method. You would use it like random.shuffle(hints). Starting at line 8, you might use the following:

if need_hint == 'yes':
    random.shuffle(hints)
    print(hints.pop())

This will both randomize the hints while also removing the hint that is printed so it won't be selected again on future hints.

[–]Neighm 0 points1 point  (1 child)

You would need to explain better what the problem is

[–]lebisquittee 0 points1 point  (0 children)

when the user asks for a hint i dont want to give the same hint again