I am very new to Python programming (15 minutes) I wanted to make a simple program that would take an input and then print it back out. This is how my code looks.
JavaScript
x
3
1
Number = raw_input("Enter a number")
2
print Number
3
How can I make it so a new line follows. I read about using n but when I tried:
JavaScript
1
3
1
Number = raw_input("Enter a number")n
2
print Number
3
It didn’t work.
Advertisement
Answer
Put it inside of the quotes:
JavaScript
1
2
1
Number = raw_input("Enter a numbern")
2
n
is a control character, sort of like a key on the keyboard that you cannot press.
You could also use triple quotes and make a multi-line string:
JavaScript
1
3
1
Number = raw_input("""Enter a number
2
""")
3