Skip to content

Instantly share code, notes, and snippets.

@leonchen417
Created January 9, 2017 02:47
Show Gist options
  • Save leonchen417/84e68901f67486ef4035866b105683e0 to your computer and use it in GitHub Desktop.
Save leonchen417/84e68901f67486ef4035866b105683e0 to your computer and use it in GitHub Desktop.
null created by leonchen417 - https://repl.it/FDVs/35
drinks = {
'martini':{'vodka','vermouth'},
'black russian' : {'vodka','kahlua'},
'white russian' : {'cream','vodka','kahlua'}
}
bruss = drinks['black russian']
wruss = drinks['white russian']
#print(bruss|wruss)
things = ['robot','rocket','pizza']
things2 =[]
'''
for element in things:
jk = str(element).capitalize()
things2.append(jk)
print(things2)
'''
surprise = ["Groucho","Chico","Harpo"]
things = [item.capitalize() for item in things]
#print(things)
surprise = [item.lower() for item in surprise]
surprise[2] = surprise[2][::-1]
surprise = [item.capitalize() for item in surprise]
#print(surprise)
e2f = {'dog':'chien','cat':'chat','walrus':'morse'}
#dict((value, key) for key, value in my_dict.iteritems())
f2e = dict((value , key) for key, value in e2f.items()) # switch keys and values
#print(f2e.values())
life = {
'animals':{'cat':['Henry','Grumpy','Lucy'],'octopi':[],'emus':[]},
'plants':{},
'others':{}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment