Printing with String Literals

来源:互联网 发布:民治单片机培训 编辑:程序博客网 时间:2024/05/17 02:47
Printing with String Literals

You can think of the interpreter as a little program that ferries information between your Python code and the computer when you click "Run." The actual window to which the interpreter spits out the output of your code is the console. (If you're familiar with JavaScript, then you know thatconsole.log logs the result of evaluating your code to the console; print is Python's version of console.log.)

If you haven't studied JavaScript, never fear! All you need to know is that print printsthe result of the interpreter's evaluation of your code to the console for you to see.

Let's start with something simple. Tryprinting "Monty Python" to the console. The syntax looks like this:

print "Your string goes here"

Don't forget the quotes (' or ")!

原创粉丝点击