Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Git Exercise Sheet - Python Programming Tasks

Welcome to the Git Exercise repository! This repository contains 20 simple Python programming exercises designed to help you practice both Python programming and Git version control.

📋 Exercise List

Each student should work on their assigned exercise:

  1. Exercise 1 - Hello World (Student 1)
  2. Exercise 2 - Sum Two Numbers (Student 2)
  3. Exercise 3 - Check Even or Odd (Student 3)
  4. Exercise 4 - Find Maximum (Student 4)
  5. Exercise 5 - String Length (Student 5)
  6. Exercise 6 - List Sum (Student 6)
  7. Exercise 7 - Reverse String (Student 7)
  8. Exercise 8 - Count Vowels (Student 8)
  9. Exercise 9 - Factorial (Student 9)
  10. Exercise 10 - Is Palindrome (Student 10)
  11. Exercise 11 - Multiply List (Student 11)
  12. Exercise 12 - Count Words (Student 12)
  13. Exercise 13 - Temperature Converter (Student 13)
  14. Exercise 14 - Find Minimum (Student 14)
  15. Exercise 15 - List Average (Student 15)
  16. Exercise 16 - Remove Duplicates (Student 16)
  17. Exercise 17 - FizzBuzz (Student 17)
  18. Exercise 18 - String to Uppercase (Student 18)
  19. Exercise 19 - Is Prime (Student 19)
  20. Exercise 20 - Square Numbers (Student 20)

🚀 Getting Started

Step 1: Clone the Repository

First, clone this repository to your local machine:

git clone https://github.com/brain-bremen/GitExercise.git
cd GitExercise

Step 2: Create Your Branch

Each student should create their own branch. Replace X with your student number (01-20):

git switch -c student-X

For example, if you are Student 5:

git switch -c student-5

Step 3: Work on Your Exercise

  1. Open your assigned exercise file (e.g., exercise_05.py for Student 5)
  2. Read the task description in the comments
  3. Implement the required function
  4. Test your code by running the file:
python exercise_05.py

Step 4: Commit Your Changes

Once you've completed your exercise, save and commit your changes:

# Check which files have been modified
git status

# Add your exercise file to staging
git add exercise_05.py

# Commit your changes with a meaningful message
git commit -m "Completed exercise 5: String Length"

Step 5: Push Your Branch

Push your branch to the remote repository:

git push origin student-5

If this is your first push on this branch, Git might ask you to set the upstream branch:

git push -u origin student-5

📚 Useful Git Commands

Here are some helpful Git commands you might need:

# Check current branch
git branch

# View commit history
git log

# View changes you've made
git diff

# Discard changes in a file (be careful!)
git checkout -- exercise_05.py

# Pull latest changes from main branch
git pull origin main

# Switch back to main branch
git checkout main

# Switch to your branch
git checkout student-5

✅ Tips for Success

  1. Test your code before committing - make sure it runs without errors
  2. Write clear commit messages - describe what you changed
  3. Use your own branch - don't work on the main branch or other students' branches
  4. Ask for help if you get stuck with Git or Python
  5. Save often and commit regularly

🆘 Common Issues

Problem: git push is rejected

  • Solution: Make sure you're on your own branch: git branch

Problem: Changes not showing up

  • Solution: Make sure you saved the file and added it: git add exercise_XX.py

Problem: Merge conflicts

  • Solution: Ask your instructor for help

📞 Need Help?

If you encounter any issues with Git or the exercises, don't hesitate to ask your instructor or classmates for help!

Happy coding! 🎉

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages