Objective

The objective of this exercise is to practice collaborating on a Python project hosted on a private GitHub repository. Students will work together to implement different arithmetic operations and utilize Git and GitHub for version control and collaboration.

Project Description

You will be working on a simple Python project called "Calculator". The project aims to provide basic arithmetic operations such as addition, subtraction, multiplication, and division.

<aside> đź’ˇ General guidelines:


Instructions

Step 1: Initialization

  1. Team Lead: Create a private GitHub repository named "Calculator" and initialize it with a README.md file.

  2. Team Lead: Make the first commit titled "Add functionality for addition" and push. Use the following code in a main.py:

    def calculate(text_input):
        if text_input[1] == "+":
            return int(text_input[0])+int(text_input[-1])
    calculation = input("What do you want to calculate?")
    answer = calculate(calculation)
    print(f"The result is {answer}")
    
  3. Team Lead: Invite the other two developers as collaborators to the private repository.

Step 2: Ticket Time 🎫

  1. Every ticket will be done by one developer.

  2. The code for every ticket should be committed locally, and pushed.

  3. Don’t worry right now if your commit was not perfect code, or had a mistake. It can always be fixed in the next commit, either by you or a colleague.

  4. These tickets are a rough outline. If things go wrong, more commits will be necessary. That is no problem.

    Tickets:

    1. Add welcome message to calculator.
    2. Add empty lines after the calculate function definition.
    3. Create main function and put code in it
    4. Add a dunder main
    5. Add functionality for subtraction
    6. Add functionality for multiplication
    7. Add functionality for division
    8. Add functionality to ask user to do multiple calculations
    9. Improve the README.md file and add project description

    <aside> ⚠️ Handling Merge Conflicts

    1. Merge conflicts can happen if there are changes in the remote repo that you do not have locally.
    2. To solve the conflict git pull and resolve merge conflict by editing the file in PyCharm and choosing the changes you want to keep.
    3. Commit the changes and push to remote repository again. </aside>

Step 3: Create new tickets yourself

  1. Continue collaborating, but think of other tickets you can come up with that can add to the project.
  2. If you don’t feel inspired, just add comments or keep adding to the README.md file.

Step 4: Intentional Merge conflict ⚡