Hidden WordScanner
Private scans · No account required

DuckieDai Molarity

Find molarity by dividing moles of solute by liters of final solution: M = mol / L.

Version 1.0.0 · Tested on a TI calculator

← Back to Calculator Program Library

Independent compatibility resource: Hidden Word Scanner is independent and is not affiliated with or endorsed by Texas Instruments. TI product names describe compatibility only.

Action-count privacy: Successful downloads, preview starts, and preview completions increment same-origin aggregate counters. No entered values, source text, IP address, account, cookie, device identifier, or fingerprint is stored with these counts.

chemistry · MIT License

Overview

Find molarity by dividing moles of solute by liters of final solution: M = mol / L.

Usage

Inputs

  • Moles of solute: 0 or more, below 1e100
  • Liters of final solution: greater than 0, below 1e100

Outputs

  • Molarity in mol/L, using M = moles / liters

Units: Enter moles of solute and liters of final solution; the result is mol/L. Convert milliliters to liters before entering.

Assumptions and limitations

Assumptions

  • The volume entered is the total final solution volume, not the amount of solvent poured in.

Constraints

  • Moles cannot be negative, and solution volume must be greater than zero.
  • Inputs and result must remain within the program's finite numeric range.

Known failures

  • Negative, non-numeric, NaN, infinite, or out-of-range moles are requested again.
  • Zero, negative, or invalid solution volume is requested again; an excessively large result stops with an error.
  • The answer is not automatically rounded to significant figures or converted from grams or milliliters.

Compatibility and review

Review status
Tested on a TI calculator
Tested on
TI-84 Plus CE Python; OS 5.8.3; Python App 5.8.3.0048; transferred through TI Connect CE as CTEST
What happened
The program ran successfully on the calculator: the duck opening appeared, Enter started the prompts, and the molarity answer displayed. Edge cases were checked on desktop only.
Dependencies
No imports
Suggested calculator name
MOLARITY — you can give it another valid, unique name when you transfer it
Desktop test cases
5 cases

The desktop tests cover calculations and error handling. The calculator review above records what was actually checked on the device.

Browser preview

Try the DuckieDai calculator screen

See the DuckieDai opening, enter moles and liters of final solution, then follow the molarity result.

Simulation boundary: This preview uses a reviewed browser adapter. It does not execute the downloaded Python and does not prove TI-Python or calculator compatibility.

JavaScript is required for the optional browser simulation. Source viewing and downloading remain available without it.

Exact reviewed bytes

Source code

Download .py

View source below, copy it when JavaScript is available, or download the exact .py bytes.

  1. """DuckieDai Molarity prototype for TI-84 Plus CE Python.
  2. Standalone source. Not yet verified on a physical calculator.
  3. """
  4. def duckiedai_intro(program_name, wait=True):
  5. """Show the same small opening as the Rectangle Area program."""
  6. title = program_name[:16]
  7. empty = 16 - len(title)
  8. left = empty // 2
  9. right = empty - left
  10. print("+----------------------+")
  11. print("| " + " " * left + title + " " * right + " |")
  12. print("| |")
  13. print("| __ |")
  14. print("| ___(o )> quack! |")
  15. print("| \\ <_. ) |")
  16. print("| `---' |")
  17. print("| by DuckieDai |")
  18. print("+----------------------+")
  19. print("Loading...")
  20. if wait:
  21. input("Press enter to start ")
  22. print("\n" * 6)
  23. def is_nonnegative_finite(value):
  24. return value >= 0 and value < 1e100
  25. def nonnegative_number(prompt):
  26. """Zero moles is valid; negative amount is not."""
  27. while True:
  28. try:
  29. value = float(input(prompt))
  30. if is_nonnegative_finite(value):
  31. return value
  32. except ValueError:
  33. pass
  34. print("Enter 0 or above.")
  35. def positive_number(prompt):
  36. """Solution volume in liters must be greater than zero."""
  37. while True:
  38. try:
  39. value = float(input(prompt))
  40. if value > 0 and value < 1e100:
  41. return value
  42. except ValueError:
  43. pass
  44. print("Enter a number above 0.")
  45. def molarity(moles, liters):
  46. """Return amount of solute divided by total solution volume."""
  47. if not is_nonnegative_finite(moles):
  48. raise ValueError("moles must be nonnegative and finite")
  49. if not liters > 0 or not liters < 1e100:
  50. raise ValueError("liters must be positive and finite")
  51. result = moles / liters
  52. if not is_nonnegative_finite(result):
  53. raise ValueError("molarity is too large")
  54. return result
  55. def main():
  56. duckiedai_intro("MOLARITY")
  57. print("MOLARITY")
  58. print("Formula: M = mol / L")
  59. print("Use solution volume, not")
  60. print("solvent volume.")
  61. print()
  62. moles = nonnegative_number("Moles solute: ")
  63. liters = positive_number("Solution L: ")
  64. result = molarity(moles, liters)
  65. print()
  66. print("M = " + str(moles) + " / " + str(liters))
  67. print("Molarity =")
  68. print(str(result) + " mol/L")
  69. print()
  70. print("DuckieDai says: done!")
  71. # TI-Python imports a selected AppVar instead of setting __name__ to main.
  72. main()
Filename
duckiedai_molarity.py
Size
2540 bytes
SHA-256
fc97f2e47224144e300d273fb015f815d741a8c9f3788f40710cdc71495ba70f

Transfer and launch

  1. Confirm that your calculator is the Python-capable model named above. Check that its OS and Python App versions match the reviewed record.
  2. Download the .py source above and verify its SHA-256 digest if your computer provides that option.
  3. Use TI Connect CE to send the Python file to a compatible calculator. MOLARITY is a suggested name; you may choose another valid, unique calculator name.
  4. Open the Python App, select the program, and check sample inputs before relying on other results.

Read the complete installation, launch, troubleshooting, and removal guide.

Availability does not mean a teacher, school, or exam permits this program. Follow the applicable rules.

Version history

Any source change requires a new immutable version and digest. Historical downloads remain available only while their review records remain valid.