I am trying to print the 8’s in four lines, I get an error when I use new line in between.
>>> print(add, sub, mul,"n"devide)
File "<stdin>", line 1
print(add, sub, mul,"n"devide)
^
SyntaxError: invalid syntax
>>> print(add, sub, mul, devide)
8 8 8 8
>>>
Tshidiso Makinta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2
You should try this:
print(add, "n", sub, "n", mul, "n", devide)
This will print all four 8s in new lines.
You shoul use this construction:
print(f"{add}n{sub}n{mul}n{devide}")
4