Search code examples
pythonstringmultiplication

How can I print 86 in new line like hello world?


Var1 = "54"
Var2 = "32"
Print(2 * "hello world\n")
Print(2 * str(int(var1)+int(var2)))

Solution

  • Concatenate a newline to the string before multiplying by 2.

    print(2 * (str(int(var1) + int(var2)) + "\n"))