Python Fundamentals Tutorial : Types
String literals can be defined with any of single quotes ('), double quotes (") or triple quotes (''' or """). All give the same result with two important differences.
- If you quote with single quotes, you do not have to escape double quotes and vice-versa.
- If you quote with triple quotes, your string can span multiple lines.
>>> 'hello' + " " + '''world''' 'hello world'
Integer literals are created by any number without a decimal or complex component.
>>> 1 + 2 3
Float literals can be created by adding a decimal component to a number.
>>> 1.0 / .99 1.0101010101010102