My computer science teacher wants me to put this phrase in one line of code. But I have no idea what to do. I have tried every possible way I could think of. Can anyone help me?
try using \n and \t in the string
@Elizabeth_Mason if I did print("A lightning flash:\nbetween the forest trees"), I'd get the following output:
print("A lightning flash:\nbetween the forest trees")
A lightning flash:
between the trees
Knowing that, are you able to figure out the rest?
@theangryepicbanana none of them will work. This is what I get every time...
@Elizabeth_Mason can I see what you typed in?
@theangryepicbanana sure give me a few minutes
@Elizabeth_Mason you don't need to add extra strings; the \n inserts a "new line" and the \t inserts a tab
@theangryepicbanana So then how do I solve it?
@theangryepicbanana Yea thank you...If I need anymore help I will contact you. Thank you!
@Elizabeth_Mason No problem! (also mark my comment as "best answer" is it helped)
@theangryepicbanana Hey I have tried with the \n and \t ... I don't know what else to do.
@Elizabeth_Mason you don't need any spaces after the \n
@theangryepicbanana no correct answer
I will ask my teacher through email...or I will ask her tomorrow
@Elizabeth_Mason ok, maybe she mistyped something for the assignment
@theangryepicbanana Maybe...Thanks again for your help!!! :):):)
@theangryepicbanana you know you can save all the hassle by typping the message inside 3 speech marks:
print("""A lightning flash:
between the forest trees
I have seen water.
It actually works