0% found this document useful (0 votes)
24 views2 pages

HW 2

Uploaded by

tongyingying.yun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views2 pages

HW 2

Uploaded by

tongyingying.yun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Git Course

Git for Personal Use

Instructor: Bui Manh Truong

TA: To Duc Anh

Date Last Edited: August 14, 2022


Lesson 2 Git Course Git for Personal Use

Create a repository on Github, name it as following:


YOUR_NAME-GIT-COURSE

• Do not forget to add README.md and .gitignore! and also set the repository to public.
• I will mainly read commit message, git status and git related stuff, so do not worry if your code cant
run.
• After finishing this home work. copy the link to the repo, and paste it here: Sheet.

• This repository will be used in the next lesson.

Problem 1
Use the code editor or IDE of your choice, create a Python file call addition two number and add the
following:

def addition(a, b):


return a + b

Use the terminal in your editor or IDE, add addition two number file, then commit it with the
message of your choice, be short but also informative. After that push the file using
git push

Problem 2
Following the above steps, create another Python file all subtract two number with the following content:

def subtract(a, b):


return a - b

Push that code into git.

Problem 3
You are now still in the main/master branch, go to your Terminal, create a new branch name:
add-divide-feature
Switch/Checkout to that branch, and do task 4 and 5.

Problem 4
Following the above steps from task 1, create another Python file all divide two number with the
following content:

def divide(a, b):


return a/b

Push that code into git.

Problem 5
The code from task 4 has a major bug, find it, fix it and then commit your edit, with a short and clear
message of what you did!

Bui Manh Truong 1 National Economics University

You might also like