Giter Club home page Giter Club logo

challenge-1's Introduction

Temperature Conversion

Challenge 1

Estimated Time to Complete

60 minutes


Learning Objectives

Start working with variables, math, and printing


Assignment Overview

The formula for converting between fahrenheit and celsius is to first subtract 32, then multiply by 5/9. Can you do the following in python?

  1. Convert a temperature of 100 degrees fahrenheit to celsius
    • Save this to a variable called celsius_100, and use print() to print out the value
    • Is the resulting temperature you get an integer or float? How do you know?
  2. Convert a temperature of 0 degrees fahrenheit to celsius
    • Save this to a variable called celsius_0, and use print() to print out the value
  3. Convert a temperature of 34.2 degrees fahrenheit to celsius
    • Do this one all in one print statement without saving any variables

Now, can you convert back?

  1. Convert a temperature of 5 degrees celsius to fahrenheit
  2. What is hotter, a temperature of 30.2 degrees celsius, or a temperature of 85.1 degrees fahrenheit?

Follow these instructions in temp_conversion.py to convert temperatures between celsius and fahrenheit, then print them out.


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 temp_conversion.py (the only .py file that is not a _test.py file)
    • Make sure to run your code often to see what changes you're making, with your computer's version of python3 temp_conversion.py in your terminal
  4. Run your computer's version of python3 -m unittest temp_conversion_test.py 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 all set!

challenge-1's People

Contributors

lschachter avatar

Watchers

 avatar  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.