Oktatás * Programozás 2 * Szkriptnyelvek * levelezősök Félévek Linkek * kalendárium |
EnPy3 /
20141005asomething_1 or something_2 or … something_N Consider this simple program: #!/usr/bin/env python3 # encoding: utf-8 import sys def main(): inp = input("Do you really want to quit [y/Y/yes]? ") if inp == 'y' or inp == 'Y' or inp == 'yes': # <- Can you simplify this? 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 ] |