Skip to content

Instantly share code, notes, and snippets.

@NurseLaura
Created September 27, 2016 03:42
Show Gist options
  • Save NurseLaura/797f3e760bf202079fc81d51abd869d7 to your computer and use it in GitHub Desktop.
Save NurseLaura/797f3e760bf202079fc81d51abd869d7 to your computer and use it in GitHub Desktop.
favorite_books = ["Midwives", "The Grapes of Wrath", "The Art of Racing in the Rain", "My Sister's Keeper", "Orphan Number Eight"]
family_tree = [{"father" : "Dave", "mother" : "Brenda", "children" : {"child_1" : "Pamela", "child_2" : "Greg", "child_3" : "Laura"}},
{"father" : "Henry", "mother" : "Gretta", "children" : {"child_1" : "Stephen", "child_2" : "David", "child_3" : "Mary Ann"}}]
# Zero tabs in Python. Indent the equivalent of FOUR spaces.
for book in favorite_books:
print("I love " + book + "!")
books = {"Midwives" : {"pg": 356 , "rating": 5}, "The Grapes of Wrath" : {"pg": 412, "rating" : 4.5},
"The Art of Racing in the Rain" : {"pg" : 319, "rating" : 4.75}, "My Sister's Keeper" : {"pg" : 501, "rating" : 4.28},
"Orphan Number Eight" : {"pg" : 401, "rating" : 4.4}}
print(books)
def name():
name = input("What is your name?")
if name == "Laura":
print("Howdy, Laura!")
else:
print("Hello, stranger!")
name()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment