Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Argument Parsing - 2/3 #141

Open
dpshelio opened this issue Nov 26, 2020 · 0 comments
Open

Argument Parsing - 2/3 #141

dpshelio opened this issue Nov 26, 2020 · 0 comments
Labels

Comments

@dpshelio
Copy link
Member

dpshelio commented Nov 26, 2020

Carrying on from the previous exercise, now We will add an optional parameter to accept weights in your latest squares.py file.

with weights

  1. Choose who in your team is sharing now! (pull the code from the previous exercise into your local repository)
    Hint: You need to add a new remote from your team member and pull their branch
  2. Create a new branch from the branch used in the previous exercise.
  3. Open the file squares.py. Make sure you can run it from a terminal with some input values!
  4. Look at the part of the file that is using argparse
  5. Add a new argument that's optional and that can accept the weights as done previously with the numbers. The file should be runnable as python squares.py <numbers>... --weights <weights>... (where <numbers> and weights should be replaced by the sequence of numbers and weights of your choice).
    • Look at the argparse documentation
    • Add the weights as argparser arguments.
    • Check the auto-generated help: python squares.py --help.
    • Check that you can run the file with the new form, whether you put the weights or not.
  6. Share your solution as a pull request mentioning this issue (by including the text Addresses #141 in the pull request description), remember to mention your team members too! (with @github_username)
@dpshelio dpshelio changed the title Argument Parsing Argument Parsing - 2/3 Nov 26, 2020
twemyss added a commit to twemyss/rse-classwork-2020 that referenced this issue Nov 26, 2020
umitozmen added a commit to umitozmen/rse-classwork-2020 that referenced this issue Nov 26, 2020
umitozmen added a commit to umitozmen/rse-classwork-2020 that referenced this issue Nov 26, 2020
@FMAUR92 FMAUR92 mentioned this issue Nov 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants