First Program - CalcPro.py
How do I make labels like in Batch so that I can 'go to' or initiate certain blocks of code when needed? And what is the command for goto? Whats the command for cls (or in other words clearing the screen)?
while 1:
import math
print
print ("CalcPro - Choose a number option to proceed")
print
print
print ("1) Add ")
print ("2) Subtract")
print ("3) Multiply")
print ("4) Divide")
print
print ("EXIT - type 'exit' at any time to close.")
print
print
choice = raw_input("Option --> ")
if choice == "exit":
ExitChoice = raw_input("Are you sure you want to exit out or CalcPro? ([Y/N])")
if ExitChoice == "y":
quit()
if choice == "1":
print
print
print ("Up to 3 numbers, if you want just 2 or 1, simply fill in 0 for the rest")
print
num1 = input("Number1 --> ")
num2 = input("Number2 --> ")
num3 = input("Number3 --> ")
Solution = num1 + num2 + num3
print
print ("Your Solution is ") + `float(Solution)`
raw_input()
if choice == "2":
print
print
print ("Up to 3 numbers, if you want just 2 or 1, simply fill in 0 for the rest")
print
num1 = input("Number1 --> ")
num2 = input("Number2 --> ")
num3 = input("Number3 --> ")
Solution = num1 - num2 - num3
print
print ("Your Solution is ") + `float(Solution)`
raw_input()
if choice == "3":
print
print
print ("Up to 2 numbers, if you want more, restart program.")
print
num1 = input("Number1 --> ")
num2 = input("Number3 --> ")
Solution = num1 * num2
print
print ("Your Solution is ") + `float(Solution)`
raw_input()
if choice == "4":
print
print
print ("Up to 2 numbers, if you want more, restart program.")
print
num1 = input("Number1 --> ")
num2 = input("Number2 --> ")
Solution = num1 / num2
print
print ("Your Solution is ") + `float(Solution)`
raw_input()
Suggestions/Feedback/Answers
Thank you all,
~FFS