Jump to content

Python converter Ideas

jato_127
Go to solution Solved by The Official Czex,

So I have to create a converter in python for my computer science class. I don't want to make a commonly used converter like Celsius to Fahrenheit or other widely used conversions. Do any of you have a conversions that are out of the ordinary? Thanks

 

Newtons to pound/feet.

 

kg/m2 to lbs/ft

So I have to create a converter in python for my computer science class. I don't want to make a commonly used converter like Celsius to Fahrenheit or other widely used conversions. Do any of you have a conversions that are out of the ordinary? Thanks

Processor-Intel - Core i9-7900X 3.3GHz , Motherboard- Gigabyte - X299 AORUS Gaming 7, RAM- G.Skill - TridentZ RGB 32GB (4 x 8GB) DDR4-4000 Memory, GPU-Zotac - GeForce GTX 1080 Ti 11GB AMP Extreme,  Case- Phanteks - Enthoo Evolv ATX Glass, Storage- Samsung - 960 EVO 250GB M.2-2280, Samsung 850 Evo 250GB SSD, Samsung 850 EVO 1TB SSD, Toshiba 4TB (PH3400U) , PSU- SeaSonic 1200W Platinum, Cooling- NZXT - Kraken X62 Rev 2, Sound-Sennheiser - HD 598SE, SURE - SM7B, OS- Windows 10 Pro.

Link to comment
Share on other sites

Link to post
Share on other sites

So I have to create a converter in python for my computer science class. I don't want to make a commonly used converter like Celsius to Fahrenheit or other widely used conversions. Do any of you have a conversions that are out of the ordinary? Thanks

 

Newtons to pound/feet.

 

kg/m2 to lbs/ft

Intel Core i7-6700K | Corsair H105 | Asus Z170I PRO GAMING | G.Skill TridentZ Series 16GB | 950 PRO 512GB M.2

 

Asus GeForce GTX 980 Ti 6GB STRIX OC | BitFenix Prodigy (Black/Red) | XFX PRO Black Edition 850W

 

 

My BuildPCPartPicker | CoC

 

Link to comment
Share on other sites

Link to post
Share on other sites

Newtons to foot/pounds.

Ohhh that's a good one.

Processor-Intel - Core i9-7900X 3.3GHz , Motherboard- Gigabyte - X299 AORUS Gaming 7, RAM- G.Skill - TridentZ RGB 32GB (4 x 8GB) DDR4-4000 Memory, GPU-Zotac - GeForce GTX 1080 Ti 11GB AMP Extreme,  Case- Phanteks - Enthoo Evolv ATX Glass, Storage- Samsung - 960 EVO 250GB M.2-2280, Samsung 850 Evo 250GB SSD, Samsung 850 EVO 1TB SSD, Toshiba 4TB (PH3400U) , PSU- SeaSonic 1200W Platinum, Cooling- NZXT - Kraken X62 Rev 2, Sound-Sennheiser - HD 598SE, SURE - SM7B, OS- Windows 10 Pro.

Link to comment
Share on other sites

Link to post
Share on other sites

Ohhh that's a good one.

 

Rememebr to mark a post as solved if I gave you a good suggestion!  :)

Intel Core i7-6700K | Corsair H105 | Asus Z170I PRO GAMING | G.Skill TridentZ Series 16GB | 950 PRO 512GB M.2

 

Asus GeForce GTX 980 Ti 6GB STRIX OC | BitFenix Prodigy (Black/Red) | XFX PRO Black Edition 850W

 

 

My BuildPCPartPicker | CoC

 

Link to comment
Share on other sites

Link to post
Share on other sites

Rememebr to mark a post as solved if I gave you a good suggestion!  :)

Yes, I have a couple of days so I am going to leave it open for a little while longer to see if anyone else has an Idea.

Processor-Intel - Core i9-7900X 3.3GHz , Motherboard- Gigabyte - X299 AORUS Gaming 7, RAM- G.Skill - TridentZ RGB 32GB (4 x 8GB) DDR4-4000 Memory, GPU-Zotac - GeForce GTX 1080 Ti 11GB AMP Extreme,  Case- Phanteks - Enthoo Evolv ATX Glass, Storage- Samsung - 960 EVO 250GB M.2-2280, Samsung 850 Evo 250GB SSD, Samsung 850 EVO 1TB SSD, Toshiba 4TB (PH3400U) , PSU- SeaSonic 1200W Platinum, Cooling- NZXT - Kraken X62 Rev 2, Sound-Sennheiser - HD 598SE, SURE - SM7B, OS- Windows 10 Pro.

Link to comment
Share on other sites

Link to post
Share on other sites

Yes, I have a couple of days so I am going to leave it open for a little while longer to see if anyone else has an Idea.

 

Ah, OK. I hope your project turns out well! Don't forget to check for unnecessary spaces before compiling. http://pep8online.com/

Intel Core i7-6700K | Corsair H105 | Asus Z170I PRO GAMING | G.Skill TridentZ Series 16GB | 950 PRO 512GB M.2

 

Asus GeForce GTX 980 Ti 6GB STRIX OC | BitFenix Prodigy (Black/Red) | XFX PRO Black Edition 850W

 

 

My BuildPCPartPicker | CoC

 

Link to comment
Share on other sites

Link to post
Share on other sites

Ah, OK. I hope your project turns out well! Don't forget to check for unnecessary spaces before compiling. http://pep8online.com/

Thanks man, when I'm done I'll post the source code for everyone here. It will probably be really ugly considering it's my first time really writing Python, but yeah thanks.

Processor-Intel - Core i9-7900X 3.3GHz , Motherboard- Gigabyte - X299 AORUS Gaming 7, RAM- G.Skill - TridentZ RGB 32GB (4 x 8GB) DDR4-4000 Memory, GPU-Zotac - GeForce GTX 1080 Ti 11GB AMP Extreme,  Case- Phanteks - Enthoo Evolv ATX Glass, Storage- Samsung - 960 EVO 250GB M.2-2280, Samsung 850 Evo 250GB SSD, Samsung 850 EVO 1TB SSD, Toshiba 4TB (PH3400U) , PSU- SeaSonic 1200W Platinum, Cooling- NZXT - Kraken X62 Rev 2, Sound-Sennheiser - HD 598SE, SURE - SM7B, OS- Windows 10 Pro.

Link to comment
Share on other sites

Link to post
Share on other sites

Hm...there's a lot you could use.  I don't know what level of physics you're in, and a lot of my units below are not commonly used until you get into second and/or third year university-level physics.  But, still, these are all things I found myself using a lot in my classes and wish I had a simple unit converter.  Here's just a braindump of commonly used units that it could be really nice to easily convert between.

 

Length/distance: Meter, inch/foot/yard/mile, furlong, lightyear, parsec, Planck length, Bohr radius

 

Area: Square meters, square inches/feet/yards/miles, acres, hectares

 

Volume: cubic meters, cubic inches/feet/yards/miles, liters, cups/quarts/pints/gallons, barrels (usually only for oil)

 

Velocity: meters/second, feet/second, kilometers/hour, miles/hour, knots (for boats), speed of light (just as a constant)

 

Temperature: Convert between Farenheit, Celsius, Kelvin, and Rankein. 

  • Rankein is an absolute temperature scale, but it uses the degree spacings of Farenheit.  Rankein is to Farenheit what Kelvin is to Celsius.  A lot of engineers in the US still use it because America is stupid.

 

Mass: Electronvolts, (kilo)grams, slugs, Planck mass, atomic mass unit, masses of various fundamental particles, mass of the sun, mass of the earth

  • Electronvolts are actually a measure of energy, used a lot for subatomic particles.  E.g., the rest mass of an electron is usually given as 0.511 MeV.  You can concert to mass by dividing by the speed of light squared (E = mc2, after all).
  • Slugs are an Imperial unit of mass, and unlike the pound, are only mass; the pound is a unit of force in a very strict sense, but it gets used equivalently as a unit of mass.  ("the mass required to genereat 1 pound of force")
  • Masses of fundamental particles/the sun/the earth could just be useful as a reference of scale.  It's not uncommon to see a stellar object referred to as having "the mass of X suns/earths".

Energy/work: Joules, Electronvolts, ergs, calories

  • Calorie = energy required to raise temperature of 1g water by 1 degree Celsius.  (if it's written as cal--if it's written as C, it's 1kg of water by 1 degree Celsius)

 

Power: Watts, ergs/second, horsepower

 

Force: Newtons, pounds, dynes

 

Also, maybe some marginally more complex converters for returning the wavelength, frequency, or velocity of a wave given the other two parameters (velocity = wavelength*frequency).

 

 

Alternately, there are a lot of just straight-up silly or extremely unusual units you could use, some of which are actually defind with a precise value:

  • Length: beard-second (how far the average beard hair grows in one second), sheppey (distance at which sheep remain picturesque), attoparsecs (or any pattern of "enormous unit of measure with miniscule SI prefix" or "miniscule unit with massive SI prefix, e.g. giga Bohr radii)
  • Time: nanocentury, jiffy (actually a defined unit!)
  • Basically anything on the Wikipedia page List of Humorous Units of Measurement.

 

And yet another alternative would be to grab a few common things of known size and put everything in terms of those.  E.g., measure area in "number of times you could fit Scotland (or some other country/state/province/whatever) in it," length is "number of Saturn 5 rockets," time in "number of average commutes to work," and so on.

 

Basically, you could go super serious and make a really useful unit converter, or you could go nuts and do some really silly--but not incorrect, as long as you define all your units!--conversions.  And, since it's not hard to convert units (it's almost always just a multiplicative factor), you could even do all of these at once!

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×