0
var1=54
var2=76
print(100*(str(var1+var2)))

output comes to be:

130130130130130130130130130130130130130130130130130130130130130130130130130130...... 

My question is how to write the answer in different lines like:

130
130
.
.

I tried using this command:print(100*(str(var1+var2)\n)) But it's not correct.

martineau
  • 119,623
  • 25
  • 170
  • 301
  • Does this answer your question? [How to append new data onto a new line](https://stackoverflow.com/questions/21839803/how-to-append-new-data-onto-a-new-line) – mkrieger1 Aug 31 '20 at 17:18

1 Answers1

2
var1=54
var2=76
print(100*(str(var1+var2) + '\n'))

Prints:

130
130
130

...and so on.

Note: personally, for readability I'd use:

for _ in range(100):
    print(var1+var2)
Andrej Kesely
  • 168,389
  • 15
  • 48
  • 91