|
print a message
|
print("Hello, World!")
|
|
asking the user for a string
|
print("What is your name? ")
|
|
single quoted
|
'example'
|
|
double quoted
|
"example"
|
|
multi-line
|
' ' ' Hello,
|
|
concatenating strings (adding strings together)
|
'Hello' + 'World'
|
|
converting strings to integers
|
int('467')
|
|
creating a variable
|
name = "Lisa"
|
|
using a variable
|
print("My name is ") + name
|
|
addition and subtraction
|
2 + 2 - 3
|
|
multiplication and division
|
10*5/5
|
|
Powers (e.g. x to the power of y)
|
3**5
|
|
Converting integers to strings
|
str(511)
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.