issue for error line of multiples-of-3-and-5 #34

Open
opened 2026-07-03 16:27:54 +02:00 by Desmond-coder · 5 comments

when i used this code :

def sum_of_natural_numbers(start, end):
total = 0
for i in range(start, end):
if i % 3 == 0 and i % 5 == 0:
total += i
return total

print(sum_of_natural_numbers(1, 1000))

the error line was:
This is the sum of numbers multiple of tree and five (15, 30, 45, ...) I need multiples of three and multiples or five (3, 5, 6, 9, 10, 12, 15, 18, ...).

i thought it might be better to be:
This is the sum of numbers ("that are multiples") of ("three") and five (15, 30, 45, ...) I need multiples of three ("or multiples of five") (3, 5, 6, 9, 10, 12, 15, 18, ...).

** i changed the multiple to that are multiples and tree to three and and multiples or five to or multiples of five.

when i used this code : def sum_of_natural_numbers(start, end): total = 0 for i in range(start, end): if i % 3 == 0 and i % 5 == 0: total += i return total print(sum_of_natural_numbers(1, 1000)) the error line was: This is the sum of numbers multiple of tree and five (15, 30, 45, ...) I need multiples of three and multiples or five (3, 5, 6, 9, 10, 12, 15, 18, ...). i thought it might be better to be: This is the sum of numbers ("that are multiples") of ("three") and five (15, 30, 45, ...) I need multiples of three ("or multiples of five") (3, 5, 6, 9, 10, 12, 15, 18, ...). ** i changed the multiple to that are multiples and tree to three and and multiples or five to or multiples of five.
Contributor

The wording in French statement may be improved too:

https://git.afpy.org/mdk/genepy-exercises/src/branch/main/exercises/multiples-of-3-and-5/wording_fr.md

"si nous listons tous les nombres multiples de 3 et 5 inférieurs à 20"

de 3 ou 5

@Desmond-coder Would you like to make a merge request? And in that case, do you need help?

The wording in French statement may be improved too: https://git.afpy.org/mdk/genepy-exercises/src/branch/main/exercises/multiples-of-3-and-5/wording_fr.md "si nous listons tous les nombres multiples de 3 et 5 inférieurs à 20" de 3 **ou** 5 @Desmond-coder Would you like to make a merge request? And in that case, do you need help?
Author

Thank you @vpoulailleau ! I'd be happy to make a merge request.
I've never created one before, so I'd really appreciate any guidance on the process.

Thank you @vpoulailleau ! I'd be happy to make a merge request. I've never created one before, so I'd really appreciate any guidance on the process.
Contributor

Here is what said ChatGPT (I will comment it afterwise):

Creating a Merge Request on a Forgejo Repository You Don't Own

When you don't own a repository on Forgejo, the typical workflow is based on forking the repository and then creating a Merge Request (called a Pull Request on some other platforms).

1. Fork the repository

  • Navigate to the original repository.
  • Click Fork.
  • This creates your own copy of the repository under your account.

2. Clone your fork

git clone https://forgejo.example.com/yourusername/project.git
cd project

3. Add the original repository as an upstream remote

This lets you keep your fork synchronized with the original repository.

git remote add upstream https://forgejo.example.com/originalowner/project.git

Verify your remotes:

git remote -v

Expected output:

origin    https://forgejo.example.com/yourusername/project.git
upstream  https://forgejo.example.com/originalowner/project.git

4. Create a feature branch

Never work directly on main (or master).

git checkout -b fix-typo

5. Make your changes

Edit the files, then stage and commit them.

git add .
git commit -m "Fix typo in documentation"

6. Push the branch to your fork

git push -u origin fix-typo

7. Open a Merge Request

  • Visit your fork on Forgejo.
  • Forgejo will often display a banner suggesting you create a Merge Request.
  • Otherwise, click New Merge Request.

Verify that:

  • Base repository is the original repository.
  • Base branch is usually main.
  • Head repository is your fork.
  • Head branch is your feature branch (fix-typo).

8. Fill in the Merge Request

Provide:

  • A clear, descriptive title.
  • A summary of what changed.
  • The reason for the change.
  • Any testing that was performed.
  • References to related issues, if applicable.

9. Respond to review feedback

If reviewers request changes:

  1. Make the requested modifications.
  2. Commit them.
  3. Push again.
git push

The Merge Request is updated automatically.

10. After the Merge Request is merged

Update your local repository:

git checkout main
git fetch upstream
git merge upstream/main
git push origin main

Optionally, delete the feature branch locally and from your fork.


Keeping your fork up to date

Before starting a new contribution, synchronize your local main branch.

git checkout main
git fetch upstream
git merge upstream/main
git push origin main

Then create a new feature branch:

git checkout -b another-feature

If you already have write access

If the project has granted you write permission, you can usually skip the fork:

  1. Clone the original repository.
  2. Create a feature branch.
  3. Push the branch to the original repository.
  4. Open a Merge Request from your branch into main.

For repositories you do not own and do not have write access to, the fork-and-merge-request workflow described above is the standard approach.

Here is what said ChatGPT (I will comment it afterwise): # Creating a Merge Request on a Forgejo Repository You Don't Own When you don't own a repository on Forgejo, the typical workflow is based on **forking** the repository and then creating a **Merge Request** (called a Pull Request on some other platforms). ## 1. Fork the repository - Navigate to the original repository. - Click **Fork**. - This creates your own copy of the repository under your account. ## 2. Clone your fork ```bash git clone https://forgejo.example.com/yourusername/project.git cd project ``` ## 3. Add the original repository as an upstream remote This lets you keep your fork synchronized with the original repository. ```bash git remote add upstream https://forgejo.example.com/originalowner/project.git ``` Verify your remotes: ```bash git remote -v ``` Expected output: ```text origin https://forgejo.example.com/yourusername/project.git upstream https://forgejo.example.com/originalowner/project.git ``` ## 4. Create a feature branch Never work directly on `main` (or `master`). ```bash git checkout -b fix-typo ``` ## 5. Make your changes Edit the files, then stage and commit them. ```bash git add . git commit -m "Fix typo in documentation" ``` ## 6. Push the branch to your fork ```bash git push -u origin fix-typo ``` ## 7. Open a Merge Request - Visit your fork on Forgejo. - Forgejo will often display a banner suggesting you create a Merge Request. - Otherwise, click **New Merge Request**. Verify that: - **Base repository** is the original repository. - **Base branch** is usually `main`. - **Head repository** is your fork. - **Head branch** is your feature branch (`fix-typo`). ## 8. Fill in the Merge Request Provide: - A clear, descriptive title. - A summary of what changed. - The reason for the change. - Any testing that was performed. - References to related issues, if applicable. ## 9. Respond to review feedback If reviewers request changes: 1. Make the requested modifications. 2. Commit them. 3. Push again. ```bash git push ``` The Merge Request is updated automatically. ## 10. After the Merge Request is merged Update your local repository: ```bash git checkout main git fetch upstream git merge upstream/main git push origin main ``` Optionally, delete the feature branch locally and from your fork. --- # Keeping your fork up to date Before starting a new contribution, synchronize your local `main` branch. ```bash git checkout main git fetch upstream git merge upstream/main git push origin main ``` Then create a new feature branch: ```bash git checkout -b another-feature ``` --- # If you already have write access If the project has granted you write permission, you can usually skip the fork: 1. Clone the original repository. 2. Create a feature branch. 3. Push the branch to the original repository. 4. Open a Merge Request from your branch into `main`. For repositories you **do not own** and **do not have write access to**, the fork-and-merge-request workflow described above is the standard approach.
Contributor

@Desmond-coder Are you using Windows, Linux or anything else?

The last paragraph is not applicable, you don't have write access.

BTW, are you comfortable with git? (If you follow the provided commands, it should work well).

Feel free to ask any questions.

@Desmond-coder Are you using Windows, Linux or anything else? The last paragraph is not applicable, you don't have write access. BTW, are you comfortable with git? (If you follow the provided commands, it should work well). Feel free to ask any questions.
Author

Thanks for your help @vpoulailleau !

I'm using Windows.
I'm still learning Git, but I know the basics (clone, commit, push, etc.). I haven't created a Merge Request before, so this will be my first one. I'll give it a try following the instructions, and if I get stuck, I'll ask.

Thanks again!

Thanks for your help @vpoulailleau ! I'm using Windows. I'm still learning Git, but I know the basics (clone, commit, push, etc.). I haven't created a Merge Request before, so this will be my first one. I'll give it a try following the instructions, and if I get stuck, I'll ask. Thanks again!
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mdk/genepy-exercises#34
No description provided.