Python Coding
|
05-16-2022, 12:06 PM
Post: #1
|
|||
|
|||
Python Coding
Been a long time, anyway while learning on how to code using the
Python Programming Language and my first program is of cause the good old "Profit on Pricing" calculations. This program I use the same algorithm on my several HP programmable calculator found elsewhere here. Here I'll share my code and this might be useful to some who also learn coding. This link user can run this program and try out. Enjoy !! Link: https://trinket.io/python/656c020f51?runOption=run Gamo 5/2022 |
|||
05-17-2022, 12:36 AM
Post: #2
|
|||
|
|||
RE: Python Coding
You can use this Python to RPN - source code converter to translate your Python code for the HP-42S.
However, I had to adjust it a little bit to make it work: Code: LBL("Profit on Pricing") Some of the generated code can be simplified a bit. For instance the following snippet: Code: if MAR == 0: # if true compute Margin … is translated to: Code: RCL "MAR" // MAR But we can use instead: Code: RCL "MAR" // MAR However the generated code to print the results doesn't appear to work. Still I hope that you have fun with Python and your programs! |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)