On 05/12/15 18:48, Deepak Nn wrote: > # Embedded file name: re4.py If you want to know the output run it. If the output you get is not what you expect tell us what you input, what you got out, what you expec6ed. Also tell us which OS and Python versions you are using.
Otherwise all I can tell you is that the output will be some combination of the various print statements depending on what input you provide(assuming there are no code errors). > import time > flag = [102, > 108, > 97, > 103, > 123, > 112, > 121, > 116, > 104, > 111, > 110, > 95, > 114, > 111, > 99, > 107, > 115, > 125] > password = raw_input('Enter secret code to get secret password: ') > sleep_hours = 10000 > print 'Going to sleep. Will check password after %d hours' % sleep_hours > print 'If you want to check password faster, find a way to prevent this > sleep' > time.sleep(sleep_hours * 60 * 60) > if password == 'strongpassword': > print 'Correct! The secret password is %s' % ''.join(map(chr, flag)) > else: > print 'Booo wrong code! No secret password for you' I suspect the question you really want to ask is about how the map() function works? It will apply the chr() function to each number in flags. >>> chr(102),chr(108),chr(97) ('f', 'l', 'a') And so on. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor