06-18-2021, 03:37 AM
Here is a simple prime python program that features formatted input and output statements.
It just averages three values entered by a user.
I included this code in another thread but I thought it might get buried
for another user looking for the formated input and output.
Thanks.
It just averages three values entered by a user.
Code:
#PYTHON name
# avg3nr03
import math
def pintro():
print("average three numbers")
def enter_3():
a,b,c = input("a,b,c? ").split(",")
print(" " + a + ", " + b + ", " + c)
return (float(a)+ float(b) + float(c))/3
def pout():
q = enter_3()
print("the average is {0:.5f}".format(q))
pintro()
pout()
#end
EXPORT avg3nr03()
BEGIN
PRINT;
PYTHON(name);
END;
I included this code in another thread but I thought it might get buried
for another user looking for the formated input and output.
Thanks.