HP Prime Python runs consecutive programs
|
09-25-2023, 03:00 PM
Post: #6
|
|||
|
|||
RE: HP Prime Python runs consecutive programs
These are the two scripts. Only difference between these and the Casio are the random imports.
Cone program. Calculates the sheet metal size for a rolled cone. from math import * import math major = input("major dia=") major = float(major) #print(major) minor = input("minor dia=") minor = float(minor) #print(minor) height = input("height=") height = float(height) #print(height) o = math.sqrt((height*major/(major-minor))**2+(major/2)**2) i = math.sqrt((height*minor/(major-minor))**2+(minor/2)**2) angle = 360*major/(2*o) r_angle = angle*(pi/180) if angle >180: x = o+o*sin(((angle-180)*(pi/180))/2) y = 2*o else: x = o-i*cos((angle/2*(pi/180))) y = 2*o*sin((angle/2*(pi/180))) print("radius 1 = {0:6.3f}".format(o)) print("radius 2 = {0:6.3f}".format(i)) print("angle = {0:6.2f}".format(angle)) print("b height = {0:6.3f}".format(x)) print("b width = {0:6.3f}".format(y)) if y>144: print("blank oversized") red.py is a list of the magic eight ball responses that comes up randomly when pressing enter. from micropython import * from urandom import * from urandom import random import random eightlist = ["It is certain ", "Reply hazy, try again", "Don’t count on it", "It is decidedly so", "Ask again later", "My reply is no", "Without a doubt", "Better not tell you now", "My sources say no", "Yes definitely", "Cannot predict now", "Outlook not so good", "You may rely on it", "Concentrate and ask again", "Very doubtful", "As I see it, yes", "Most likely", "Outlook good", "Yes", "Signs point to yes" ] shake = "" while True: shake = input("Shake for answer ") if shake == "": print (random.choice(eightlist) ) #print (eightlist[eightball]) else: print ("Thanks for playing") break Cone runs then at the end, it displays <import> red.py and runs that program. |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
HP Prime Python runs consecutive programs - Pellidon - 09-22-2023, 07:42 PM
RE: HP Prime Python runs consecutive programs - Guenter Schink - 09-23-2023, 05:57 PM
RE: HP Prime Python runs consecutive programs - toml_12953 - 09-24-2023, 03:50 PM
RE: HP Prime Python runs consecutive programs - Guenter Schink - 09-24-2023, 07:14 PM
RE: HP Prime Python runs consecutive programs - Pellidon - 09-24-2023, 09:50 PM
RE: HP Prime Python runs consecutive programs - Pellidon - 09-25-2023 03:00 PM
RE: HP Prime Python runs consecutive programs - Guenter Schink - 09-28-2023, 09:31 PM
RE: HP Prime Python runs consecutive programs - Pellidon - 09-29-2023, 05:47 PM
RE: HP Prime Python runs consecutive programs - Guenter Schink - 09-29-2023, 06:31 PM
RE: HP Prime Python runs consecutive programs - toml_12953 - 09-29-2023, 08:36 PM
|
User(s) browsing this thread: 1 Guest(s)