Giter VIP home page Giter VIP logo

getting-for-physic-class's Introduction

Getting Ready for Physics Class

You are a physics teacher preparing for the upcoming semester. You want to provide your students with some functions that will help them calculate some fundamental physical properties.


Tasks


Turn up the Temperature

1. Write a function called f_to_c that takes an input f_temp, a temperature in Fahrenheit, and converts it to c_temp, that temperature in Celsius


2. Let’s test your function with a value of 100 Fahrenheit

Define a variable f100_in_celsius and set it equal to the value of f_to_c with 100 as an input.


3. Write a function called c_to_f that takes an input c_temp, a temperature in Celsius, and converts it to f_temp, that temperature in Fahrenheit

Temp (F) = Temp (C) * (9/5) + 32

4. Let’s test your function with a value of 0 Celsius

Define a variable c0_in_fahrenheit and set it equal to the value of c_to_f with 0 as an input.


Use the Force

5. Define a function called get_force that takes in mass and acceleration. It should return mass multiplied by acceleration


6. Test get_force by calling it with the variables train_mass and train_acceleration

Save the result to a variable called train_force and print it out.

train_mass and train_acceleration have been defined for you at the top of script.py. Make sure to uncomment those lines before trying to use these variables.


7. Print the string “The GE train supplies X Newtons of force.”, with X replaced by train_force


8. Define a function called get_energy that takes in mass and c

c is a constant that is usually set to the speed of light, which is roughly 3 x 10^8. Set c to have a default value of 3*10**8.

get_energy should return mass multiplied by c squared.


9. Test get_energy by using it on bomb_mass, with the default value of c. Save the result to a variable called bomb_energy

bomb_mass has been defined for you at the top of script.py. Make sure to uncomment this line before trying to use bomb_mass.


10. Print the string “A 1kg bomb supplies X Joules.”, with X replaced by bomb_energy


Do the Work

11. Define a final function called get_work that takes in mass, acceleration, and distance

Work is defined as force multiplied by distance. First, get the force using get_force, then multiply that by distance. Return the result.


12. Test get_work by using it on train_mass, train_acceleration, and train_distance. Save the result to a variable called train_work


13. Print the string "The GE train does X Joules of work over Y meters.", with X replaced with train_work and Y replaced with train_distance


THIS PROJECT WAS COMPLETED BY NALINI VO

getting-for-physic-class's People

Contributors

nalini1998 avatar

Stargazers

 avatar  avatar

Watchers

 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.