-4

Hey so I'm complete new to programming and python and can't figure out what I did wrong in my first programm. I tried googling it but every other solution I found and tried didn't work I always get the same error message. Could maybe someone tell me what I did wrong? :)

I want that I am able to multiply until I put no into the last input.

welcome = "Welcome to Multiplyer!!!"
print(welcome)
name = input("Hello, please input your name: ")
print("Hello " + name + ", thank you for using Multiplyer")

while True:
print("Select two numbers")

num1 = int(input("Number 1: "))
num2 = int(input("Number 2: "))


print(num1 * num2)

 n = raw_input("Wanna multiply again? ")
    if n.strip() == 'no':
        break
user2357112
  • 260,549
  • 28
  • 431
  • 505
mercury33
  • 1
  • 1
  • 2

2 Answers2

0

In Python, indentation is a part of the language, so the content of the while loop should be indented:

welcome = "Welcome to Multiplyer!!!"
print(welcome)
name = input("Hello, please input your name: ")
print("Hello " + name + ", thank you for using Multiplyer")

while True:
    print("Select two numbers")

    num1 = int(input("Number 1: "))
    num2 = int(input("Number 2: "))


    print(num1 * num2)

    n = input("Wanna multiply again? ")
    if n.strip() == 'no':
        break
shayelk
  • 1,606
  • 1
  • 14
  • 32
0

Try this :

welcome = "Welcome to Multiplyer!!!"
print(welcome)
name = input("Hello, please input your name: ")
print("Hello " + name + ", thank you for using Multiplyer")

while True:
    print("Select two numbers")

    num1 = int(input("Number 1: "))
    num2 = int(input("Number 2: "))


    print(num1 * num2)

    n = raw_input("Wanna multiply again? ")
    if n.strip() == 'no':
        break
Aaditya Ura
  • 12,007
  • 7
  • 50
  • 88