Oktatás * Programozás 2 * Szkriptnyelvek * levelezősök Félévek Linkek * kalendárium |
EnPy /
20141005asomething_1 or something_2 or … something_N Consider this simple program: #!/usr/bin/env python # encoding: utf-8 import sys def main(): inp = raw_input("Do you really want to quit [y/Y/yes]? ") if inp == 'y' or inp == 'Y' or inp == 'yes': # <- Can you simplify this line? print 'bye' sys.exit(0) # for any other input: print 'The show goes on...' ############################################################################## if __name__ == "__main__": main() How could the line " |
Blogjaim, hobbi projektjeim * The Ubuntu Incident [ edit ] |