dimanche 6 novembre 2016

What is the "english translation" of if not in this script?

import random

dirty = True scrub_count = 0

while(dirty): scrub_count += 1 print('scrub the pan {}'.format(scrub_count))

 if not random.randint(0,5):
    print('all clean')
    dirty = False


 else:
     print('NOPE STILL SOME WORK TO DO')

I absolutely do not get how "if.not random.randinit(0,5)" translates, or how that line of code renders the scrub_count meet the random number. For me the logical way to put it would be .. if scrub_count is equal to random number then.. print "all clean".

Thank you for your help

Aucun commentaire:

Enregistrer un commentaire