Git Product home page Git Product logo

challenge-0-pchristscribe's Introduction

Hello, World

Challenge 0

Welcome to JTC! This challenge 0 is meant to familiarize you with how to use these GitHub repos to turn in your coding challenges.


Estimated Time to Complete

10 minutes


Learning Objectives

Understand how to complete and turn in JTC coding challenges


Assignment Overview

Clone this repo to your computer, then follow the steps in this how-to video to complete and turn in the assignment.


How to use Challenge Repos

How do you use this type of repo? Let's walk through it.

First thing's first, let's get this repo downloaded onto your computer. The process is the same as cloning any repo (take a look at the JTC video on how, or google it if you aren't sure!). Once it's cloned onto your computer, make sure to cd into it in your command line so you have immediate access to all the files.

There are multiple files here, but you'll only be working in one (hello.py-- see instructions there). Let's briefly take a look at what the others are.


gitignore

Most GitHub repos will (and should) have a .gitignore file. This tells your local computer what files to ignore when tracking files in git. For instance, Mac computers create a hidden .DS_Store file in every folder on your computer. We can use the .gitignore file to make sure that those files don't end up in the GitHub repo.

(EXTRAS: Notice how both .gitignore and .DS_Store start with a .? The dot tells us that these are 'hidden files', files that most users will want to ignore, so the computer hides it from us. Google how to reveal hidden files on your computer and take a look!)


README.md

Good GitHub repos will also have a README.md file, to describe what's inside the repo. You're reading this repo's README.md file right now! The .md file extension tells us that README files are written in a language called markdown. Take a look at the file to see the underlying characters that the browser turns into HTML when dispalying it.


hello_test.py

Good code has tests! hello_test.py enables you to test your code to see if it's working properly. This file will also run automatically when you turn in your homework. This means you'll be able to see how you did and make changes without waiting for us to grade it by hand. Python comes with a built in way to write tests called unittest.

DO NOT EDIT THIS FILE.

To run the tests (after you've completed the assignment:

  1. Go into your terminal
  2. Make sure you are cd'd into your challenge folder (you can also run the command ls-- if you see your hello_test.py file, you're in the right place)
  3. Run the command python3 -m unittest hello_test <-- NOTE: python3 may not be the right command on your computer. Whatever command runs Python 3 for you (python3, py, python), use that one

and check it out! The tests will either pass (OK) or fail, in which case you should see an error that will help explain what went wrong.


And finally:

hello.py

This is where your code goes. Just like elsewhere, there are elements here that we won't go into yet, but you don't need to understand them to do the challenge. The provided code looks like this:

def hello_world():
    # WRITE ALL OF YOUR CODE (INDENTED) HERE
    # print out the string 'Hello World!'
    

All of the code you write should be indented into the hello_world function. What that means is that all of your code should start at the same indentation level as the comments above:

def hello_world():
    # WRITE ALL OF YOUR CODE (INDENTED) HERE
    # print out the string 'Hello World!'
    print('Your code goes here!')
    

Try it out and see if you can get the tests to pass, then push your changes and you're all set!


Summary

  1. Accept the challenge via the GitHub Classroom link (if you're already here, you've done this part!)
  2. Clone the repo to your computer
  3. Follow the instructions in hello.py (the only .py file that is not a _test.py file) so that it prints out 'Hello World!'
  4. Run your computer's version of python3 -m unittest hello_test to see if your code works as expected
  5. git add, git commit, git push your code, and look for the little green check mark on your repo that tells you your tests passed

And you're good to go!

challenge-0-pchristscribe's People

Contributors

github-classroom[bot] avatar pchristscribe avatar

Watchers

Lillie Schachter avatar Paul A. Bloom avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.