Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # By EthPunch
- def start():
- print("Welcome to multiplication with addition!\nThis program is a simple multiplication machine, but works by adding the numbers together a specified amount of times.")
- enterNumbers()
- def enterNumbers():
- num1 = int(input("Please enter number 1... "))
- num2 = int(input("Cool. Now enter number 2... "))
- print("Awesome! I'm calculating the answer to", num1, "*", num2, "now!")
- calculate(num1, num2)
- def calculate(num1, num2):
- org1 = num1
- num2 = num2 - 1
- for ans in range(0, num2):
- num1 = num1 + org1
- ans = num1
- print("The answer to your sum is", ans, ".")
- start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement