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

Make a PR #2

Closed
nedtwigg opened this issue Feb 16, 2024 · 1 comment
Closed

Make a PR #2

nedtwigg opened this issue Feb 16, 2024 · 1 comment

Comments

@nedtwigg
Copy link
Member

I laid out a project structure for selfie-lib. Here is a function:

def fizzbuzz(n):
fizzbuzz_results = []
for i in range(1, n + 1):
if i % 3 == 0 and i % 5 == 0:
fizzbuzz_results.append("FizzBuzz")
elif i % 3 == 0:
fizzbuzz_results.append("Fizz")
elif i % 5 == 0:
fizzbuzz_results.append("Buzz")
else:
fizzbuzz_results.append(f"{i}")
return fizzbuzz_results

And here is its test:

def test_fizzbuzz():
assert fizzbuzz(15) == [
"1",
"2",
"Fizz",
"4",
"Buzz",
"Fizz",
"7",
"8",
"Fizz",
"Buzz",
"11",
"Fizz",
"13",
"14",
"FizzBuzz",
]

I made them in this PR

If you look in the PR, you'll see that most of the commits have red xs. Click a few to see what the failures look like.

Check out the readme, and make sure you're able to run this silly little test:

https://github.com/diffplug/selfie-python-wip/blob/main/python/README.md

Your task for this week:

  • Next to ned.py, create make a file yourname.py and put a silly function in it. Can be anything. Maybe ask ChatGPT to write a silly and trivial python function.
  • Next to ned_test.py, create a yourname_test.py, and write a test for your function.

As soon as you have something, commit and push it up in a draft PR. Make some red X's. Then fix the problems one by one until it's green. When it's green and you're happy with it, change it "Ready for Review" and request a review from everyone else on the team.

If you get stuck at any point

  • ask ChatGPT
  • if you're still stuck, ask in the #selfie slack channel
@nedtwigg
Copy link
Member Author

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant