xxxxxxxxxx
#code
question = input('Name the character that prints string characters on a new line \n')
print(question)
if question == 'python newline character'
print('You're a genius!')
#output
Name the character that prints string characters on a new line
|
xxxxxxxxxx
# When you want to print in a new line you can write '\n' to indicate the start of the line
# Remember '\n' is one character not two
stuff1 = 'Hello\nWorld!'
print(stuff1) # Output: Hello
# World
stuff2 = 'X\nY'
print(stuff2) # Output: X
# Y
print(len(stuff2)) # Output: 3