Welcome to the "Hello World!" exercise! This assignment is designed to familiarize you with the process of completing and turning in coding challenges using GitHub repositories.
By the end of this assignment, you should understand the steps involved in:
- Cloning a repository
- Navigating repository contents
- Reading instructions
- Writing code
- Running tests using pytest
- Pushing changes to GitHub
In this assignment, you will:
- Clone this GitHub repository to your local computer
- Follow the instructions outlined in this
README.md
file - Write Python code in the
hello.py
file to print "Hello World!" - Run the provided tests using pytest to verify your code (screenshot the results)
- Push your changes back to GitHub
Upon completing this assignment, you will:
- Understand how to complete and turn in coding challenges using GitHub repositories
- Learn to navigate repository contents and read instructions provided within files
- Practice writing Python code to fulfill given requirements
- Gain familiarity with running tests using pytest and interpreting their results
To get started with the assignment, follow these steps:
-
Clone this repository to your local computer using the following command:
git clone <repository-url>
-
Navigate to the cloned repository directory using your Command Line Interface (CLI):
cd <folder name>
-
Open the
hello.py
file in your preferred code editor.
-
Locate the
hello_world()
function in thehello.py
file. -
Write Python code within the
hello_world()
function to print "Hello World!". -
Save the
hello.py
file after writing your code. -
Run the provided tests using pytest to verify your code:
- Install pytest if not already installed:
pip install pytest
- Run the tests:
pytest test_hello.py
- Install pytest if not already installed:
-
If the tests pass, congratulations! You have completed the coding part of the assignment. If the tests fail, make necessary adjustments to your code and repeat step 4 until the tests pass. Take a screenshot and add it to Canvas.
-
Once your code passes the tests, it's time to push your changes to GitHub:
- Stage your changes:
git add .
- Commit your changes with a meaningful commit message:
git commit -m "Implement hello_world() function"
- Push your changes to GitHub:
git push origin main
- Stage your changes:
-
Verify that your changes have been successfully pushed to the repository by checking the GitHub repository page.
-
Submit the link to your GitHub repository on Canvas.
The estimated time to complete this assignment is approximately 20 minutes.
Submit the link to your GitHub repository on Canvas once you have completed the assignment.
Add your passing pytest screenshot.