Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. import argparse
  2.  
  3. parser = argparse.ArgumentParser(description='A tutorial of argparse!')
  4. parser.add_argument("--a", default=1, type=int, help="This is the 'a' variable")
  5. parser.add_argument("--education", choices=["highschool", "college", "university", "other"],
  6. required=True, type=str, help="Your name")
  7.  
  8. args = parser.parse_args()
  9.  
  10. ed = args.education
  11.  
  12. if ed == "college" or ed == "university":
  13. print("Has degree")
  14. else:
  15. print("Does not have degree")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement