textin = input("Tell me something: ") # blank lines are white space the computer ignores them #new line \n starts the text on another line print("\nThis is what you told me: ") #next line goes on a new line automatically print(textin) #you can also put your strings together with a + print("\nThis is what you told me: " + textin) print("\nThis is what you told me: " + textin + " that's nasty!") print(textin + " I hope it's not a secret ") #new line \n start the text on another line #comma , starts the next text on the same line print("\nThis is what you told me: "), print(textin) #------------------------------------------------------- # some examples: print("newline "), print("\nnew line followed by sameline "), print("followed by sameline "), print("whatever previous says followed by newline ") #-----DO-IT---------------------------------------------- # Try it yourself, create two variables, one for your first name one for your second name then # print them out # 1. first name then second name on different lines # 2. first name then second name on the same line # 3. first name then second name
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question