I don't know how this doesn't work

can someone help me please i am a newbie to programming and wanted to make a simple and fun game
it’s only the code to one function but here it is

def rigged():
a = raw_input(‘heads or tails’).lower()
if a == “heads”:
print ‘tails’
elif a == “tails”:
print ‘heads’

please tell me what is wrong with the code

1 Like

You can use print to write out what is being done, and compare to what you intended. If they don’t match then you’ve found your bug. (And if they match there isn’t a bug, because then you showed that it did the right thing)

1 Like

i’m sorry but i’m confused

1 Like

Bugs are found by comparing what happens to what should happen.
You should already know what should happen (otherwise you can’t write the code for it), and you can observe what does happen by printing.
So, it seems like you have all the information you need to proceed!


ok thank you very much