8 * 3.57
8 x 3.57
5+30*20
5 + 30 * 20
(5 + 30) * 20
((5 + 30) * 20) / 10
5 + 30 * 20 / 10
fred = 100
print(fred)
fred = 200
john = fred
print(fred)
print(john)
20 + 10 * 365
3 * 52
3670 - 156
20 + 10 * 365 - 3 * 52
found_coins = 20
magic_coins = 10
stolen_coins = 3
found_coins + magic_coins * 365 - stolen_coins * 52
stolen_coins = 2
found_coins + magic_coins * 365 - stolen_coins * 52
found_coins + magic_coins * 365 - stolen_coins * 52
found_coins + magic_coins * 365 - stolen_coins * 52
abcd123456789
x
x = 0
x
x = "abcd1234"
x
"i am hzg"
# “i am hzg“
"the name of this book is \"python\""
'the name of this book is \"python\"'
'the name of this book is "python"'
# "the name of this book is "python""
"the name of this book is 'python'"
fred = '''How do dinosaurs pay their bills?
with tyrannosaurus checks!'''
print(fred)
fred = """How do dinosaurs pay their bills?
with tyrannosaurus checks!"""
print(fred)
fred
fred = """How do dinosaurs pay their bills?
with tyrannosaurus checks!"""
fred = """
   first
   second
   third
"""
fred
silly_string = 'He said, "Aren't can't shouldn't wouldn't.'
silly_string = 'He said, "Aren't can't shouldn't wouldn't."'
silly_string = 'He said, 'Aren't can't shouldn't wouldn't.''
silly_string = "He said, "Aren't can't shouldn't wouldn't.""
silly_string = 'He said, "Aren't can't shouldn't wouldn't."'
silly_string = 'He said, "Aren\'t can\'t shouldn\'t wouldn\'t."'
silly_string
print silly_string
# silly_string = "He said,"Aren't can't shouldn't wouldn't.""
silly_string = "He said,\"Aren't can't shouldn't wouldn't.\""
print(silly_string)
silly_string = "He said,'Aren't can't shouldn't wouldn't.'"
silly_string
silly_string = '''He said,"Aren't can't shouldn't wouldn't."'''
silly_string = He said,"Aren't can't shouldn't wouldn't."
silly_string = '''
He said,"Aren't can't shouldn't wouldn't."
'''
print silly_string
myscore = 1000
message = 'I scored %s points'
print(message % myscore)
'I scored %s points' % 1000
'I scored %s points' % myscore
message % 1000
message % myscore
'I scored %d points' % myscore
'I scored %d points' % "test"
'I scored %s points' % "test"
nums = 'What did the number %s say to the number %s? Nice belt!!'
print(nums % (0,8))
nums = 'What did the number %s say to the number %s? Nice belt!!'
print(nums % 5)
nums = 'What did the number %s say to the number %s? Nice belt!!'
print(nums % (5,5))
print(10 * 'a')
aaaaaaaaaa
'aaaaaaaaaa'
'a' * 10
'a ' * 10
'a_' * 10
'a_a' * 10
'a a' * 10
' ' * 10
'a' + 10
'a' + 'b'
b = 10
'a' + b
b = '10'
'a' + b
"hello world"
"hello" + "world"
"hello" + " " + "world"
"hello" + " "*10 + "world"
("hello" + " " + "world") * 2
a = "hello"
b = "world"
a + b
a = "hello"
c = ' '
b = "world"
a + b + c
a + c + b
wizard_list = 'spider legs,toe of frog,eye of newt,bat wing,slug butter,snake dandruff'
print(wizard_list)
wizard_list = ['spider legs','toe of frog','eye of newt','bat wing','slug butter','snake dandruff']
print(wizard_list)
len()
len(wizard_list)
print(wizard_list[2])
print(wizard_list[1])
print(wizard_list[0])
wizard_list[2] =
wizard_list[2]
wizard_list[2] = 'snail tongue'
print(wizard_list)
print(wizard_list[2:5])
print(wizard_list[2:6])
print(wizard_list[2:len(wizard_list)])
print(wizard_list[2:-1])
print(wizard_list[2:-2])
print(wizard_list[2:])
print(wizard_list[2:7])
print(wizard_list[2:8])
print(wizard_list[8])
numbers = [1,2,3,4]
numbers
numbers.append('5')
print(numbers)
numbers.append(5)
print(numbers)
numbers[4] = 5
print(numbers)
numbers[len(numbers)]
numbers[len(numbers)] = 6
numbers[len(numbers)-1] = 6
print(numbers)
del numbers[4]
print(numbers)
del numbers[4]
print(numbers)
del numbers[3]
print(numbers)
del numbers[2]
print(numbers)
n1 = [1,2]
n2 = [3,4]
print(n1 + n2)
n3 = n1 + n2
print(n3)
print(n1 * 5)
print(n1 + 5)
print(n1 + [5])
n1 / [5]
x = [[1,2], [3,4]]
x
x[0]
x[[0]]
x[0][0]
(x[0])0
(x[0])[0]
x[1][0]
fibs =
fibs = (0,1,1,2,3)
print(fibs[3])
fibs[3] = 4
x = 'hello'
x[0]
len(x)
