mercredi 29 août 2018

when is an 'if' statement code incorrect even after giving an output?

am completely new to programming and I am learning through edX now and I came across this code but I do not really know why the code is termed incorrect even though it gives an output. would have asked on the edx platform but the course finished two years ago, just learning from what is archived. Thanks .

The result is 'i win' and 'tie' it has an output so why is it still incorrect?

comp = 'rock'
user = 'rock'

if comp == 'rock':
    print 'I win *_*!'
if user == 'paper':
    print 'You win.'
else:
    print 'Tie.'

Aucun commentaire:

Enregistrer un commentaire