Skip to content

Commit

Permalink
add week3 github homework
Browse files Browse the repository at this point in the history
  • Loading branch information
ch1pkav committed Oct 4, 2023
1 parent 035ed27 commit d2938f6
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 0 deletions.
64 changes: 64 additions & 0 deletions homework/github_week3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Week 3 Homework: Git & GitHub

Welcome to week 3 of Linux Club! This week, your homework is to be done in-class, in teams of 3-4 people.

## Task

We have prepared a template of a tiny Python project in this directory, in the file `fibonacci.py`. Your task here is to take a number as input from the user and print the corresponding number of Fibonacci terms. The catch is, you have to use the [nth term formula](https://r-knott.surrey.ac.uk/Fibonacci/fibFormula.html). This formula is to be calculated using the functions defined in the Python file.

## Steps

The instuctions for completing the assignment are as follows:

1. Fork the [Linux Club repo](https://github.com/ucu-computer-science/UCU_Linux_Club) to your GitHub profile.
2. Add collaborators to the repo on GitHub (split into teams of 3-4 people)
2. Clone the repo to your machine

```{bash}
git clone <link to your fork>
```
3. Each person should create their own branch to make changes

```{bash}
git branch <name of branch>; git checkout <name of branch>
```
4. Split the tasks up between the members of your team
4. Each person navigates to the homework directory and does their task
5. Each person pushes their changes to their branch in the repo

```{bash}
git add .
```

```{bash}
git commit -m "commit name"
```

```{bash}
git push origin <name of branch>
```

6. Pull the changes made by others from GitHub

```{bash}
git pull origin master
```

6. Checkout to main branch and merge your changes

```{bash}
git checkout master
```

```{bash}
git merge <name of branch>
```

7. Push the master branch to GitHub


```{bash}
git push origin master
```

8. Create a pull request to the main repo.
46 changes: 46 additions & 0 deletions homework/github_week3/fibonacci.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
"""
This is a Python script that takes a number as input from the
user and returns the corresponding number of Fibonacci terms.
It uses the formula for the nth term of the Fibonacci sequence
and functionally decomposes the calculations.
Fill in all the missing code in the functions and in main
"""
import typing

def get_input() -> int:
"""Gets input from the user and returns it as an integer"""
pass


def fibonacci_list(n: int) -> typing.List[int]:
"""Returns a list of the first n Fibonacci numbers"""
pass


def fibonacci_single(n: int) -> int:
"""Returns the nth Fibonacci number"""
pass


def golden_ratio(n: int) -> float:
"""Returns the golden ratio, used in calculations"""
pass


def power(num: int, n: int) -> int:
"""Raises num to the nth power"""
pass


def sqrt(num: int) -> float:
"""Returns the square root of num"""
pass


def main():
"""Main function"""
pass


if __name__ == "__main__":
main()

0 comments on commit d2938f6

Please sign in to comment.