Skip to content

Anya-Thoughtmane/code-change-test

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Github code change challenge.

##Step 1: Do you have a GitHub account?

Make sure that you have signed up for GitHub here. You should use you school email account and your username should match. eg (email: [email protected] username: jsmith1234) ##Step 2: Make a copy of this repository

A repository is a type of folder on github. Making a copy of a respoistory is called forking. Click on the 'Fork' button at the top of the screen on the right hand side, and a copy of everything in this respoitory called code-change-test will appear in your account.

Now the resources for this unit have been forked to your github account page, you can find them here. Now work through the activities in.

##Step 3: Find the code!

Now navigate back to your account and find the starter code called greenBottles.py. The code will look like this but will be in a text file:

print("10 green bottles, hanging on the wall")
print("10 green bottles, hanging on the wall")
print("And if 1 green bottle should acidentally fall,")
print("They'll be 9 green bottles hanging on the wall.")

##Step 4: Copy the code into IDLE

Next you will want to transfer the text file containing the code from your computer to IDLE. You can use the copy to clipboard button to copy and paste the code into a text file on your computer, or you can download the entire repository using the download zip button.

##Step 5: Change the code

Open the code and develop it. Complete the rhyme making it count down to 0 green bottles. Try to write this as efficiently as you possibly can. Add some timings.

##Step 6: Upload the changed code to Github

The easiest way for you to do this without having to use the command line is to open the file on github by clicking on the greenBottles.py file in your forked repository. (Not our original!) Then click on edit. You can then paste your new code over the top. To save your code you need to commit it to the repository. You will notice that there is a comment box in which you can give a description to the code that you have changed. Add an explanantion here and then click on Commit Changes.

Step 7 : Further Challenges

Look at the grid.py code and try to complete it to draw a 5 by 5 grid, can you make this as simple as possible? Use loops? Can you turn this into a function?

The linearSearch.py code looks through a text string and counts the number of times that a character appears, can you adapt it to find a choosen character and replace it with another?

Pick a task, develop the code and save changes back to github.

About

First time test of using git hub to set and gather work.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%