Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 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",
  6. choices=["highschool", "college", "university", "other"],
  7. required=True, type=str, help="Your name")
  8.  
  9. args = parser.parse_args()
  10.  
  11. ed = args.education
  12.  
  13. if ed == "college" or ed == "university":
  14. print("Has degree")
  15. elif ed == "highschool":
  16. print("Finished Highschool")
  17. else:
  18. print("Does not have degree")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement