Advertisement
EthPunch

Multiplication with addition!!!

Jul 31st, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. # By EthPunch
  2. def start():
  3.     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.")
  4.     enterNumbers()
  5. def enterNumbers():
  6.     num1 = int(input("Please enter number 1... "))
  7.     num2 = int(input("Cool. Now enter number 2... "))
  8.     print("Awesome! I'm calculating the answer to", num1, "*", num2, "now!")
  9.     calculate(num1, num2)
  10. def calculate(num1, num2):
  11.     org1 = num1
  12.     num2 = num2 - 1
  13.     for ans in range(0, num2):
  14.         num1 = num1 + org1
  15.         ans = num1
  16.     print("The answer to your sum is", ans, ".")
  17. start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement