Last active
September 30, 2019 11:04
-
-
Save GeorgeSeif/1b41fe5c511d1e28116e19776efe1732 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import argparse | |
| parser = argparse.ArgumentParser(description='A tutorial of argparse!') | |
| parser.add_argument("--a", default=1, type=int, help="This is the 'a' variable") | |
| parser.add_argument("--education", | |
| choices=["highschool", "college", "university", "other"], | |
| required=True, type=str, help="Your name") | |
| args = parser.parse_args() | |
| ed = args.education | |
| if ed == "college" or ed == "university": | |
| print("Has degree") | |
| elif ed == "highschool": | |
| print("Finished Highschool") | |
| else: | |
| print("Does not have degree") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment