Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # IPython log file
- x = 6
- y = 5
- x, y = y, x
- print x
- print y
- get_ipython().magic(u'logstart')
- print "Hello" if True else "World"
- nfc = ["Seahawks", "Packers"]
- afc = ["Broncos", "Chargers"]
- print nfc + afc
- print str(1) + " world"
- `1` + "world"
- `1` + " world"
- print 1, "world"
- print nfc, 1
- print 5.0//2
- print 2**5
- print .3/.1
- print .3//.1
- x = 2
- if 3 > x > 1:
- print x
- if 1 < x > 0:
- print x
- nfc = ["Seahawks", "Packers"]
- afc = ["Broncos", "Chargers"]
- for teama, teamb in zip(nfc, afc):
- print teama + " vs. " + teamb
- get_ipython().magic(u'colors')
- get_ipython().magic(u'pinfo %colors')
- get_ipython().magic(u'color linux')
- get_ipython().magic(u'colors linux')
- hello world
- nfc = ["Seahawks", "Packers"]
- afc = ["Broncos", "Chargers"]
- for teama, teamb in zip(nfc, afc):
- print teama +
- " vs. " + teamb
- for teama, teamb in zip(nfc, afc):
- print teama + " vs. " + teamb
- get_ipython().magic(u'colors lightbg')
- get_ipython().magic(u'colors linux')
- get_ipython().system(u'ls -F --color --colors')
- get_ipython().system(u'ls -F --color --color')
- compare.py
- compare
- get_ipython().magic(u'run compare')
- get_ipython().system(u'ls -F --color --color')
- ipython_log
- get_ipython().magic(u'run ipython_log')
- get_ipython().magic(u'run strings/string_capwords')
- get_ipython().magic(u'run strings/string_template')
- get_ipython().magic(u'run parallel/parallel')
- get_ipython().magic(u'run parallel/parallel.py')
- get_ipython().system(u'ls -F --color --color')
- get_ipython().magic(u'pwd --color')
- import code
- get_ipython().magic(u'pinfo2 code')
- get_ipython().system(u'ls -F --color ')
- get_ipython().magic(u'cd regex/')
- get_ipython().system(u'ls -F --color ')
- get_ipython().magic(u'pwd ')
- import re_email_verbose
- get_ipython().magic(u'pinfo2 re_email_verbose')
- get_ipython().system(u'ls -F --color --colors')
- get_ipython().system(u'ls -F --color --color')
- get_ipython().magic(u'cd ..')
- get_ipython().system(u'ls -F --color --color')
- get_ipython().magic(u'pwd ')
- for teama, teamb in zip(nfc, afc):
- print teama + " vs. " + teamb
- teams ["Packers", "Seahawks", "Broncos", "Cowboys"]
- teams = ["Packers", "Seahawks", "Broncos", "Cowboys"]
- for index, team in enumerate(teams):
- print index, team
- numbers = [1,2,3,4,5,6]
- even= []
- for number in numbers:
- if number%2 == 0:
- even.append(number)
- numbers = [1,2,3,4,5,6]
- even = [number for number in numbers if number%2 == 0]
- teams = ["Packers", "Seahawks", "Broncos", "Cowboys"]
- print {key: value for value, key in enumerate(teams)}
- items = [0]*3
- print items
- [0,0,0]
- teams = ["Packers", "Seahawks", "Broncos", "Cowboys"]
- print ", ".join(teams)
- data = {'user': 1, 'name': 'Max', 'three': 4}
- try:
- is_admin = data['admin']
- except KeyError:
- is admin = False
- data = {'user': 1, 'name': 'Max', 'three': 4}
- is admin = data.get('admin', False)
- x = [1,2,3,4,5,6]
- print x[:3]
- print x[1:5]
- for x in range(0,101):print"Fizz"[x%3*4:]+"Buzz"[x%5*4]or x
- for x in range(1,101):print"Fizz"[x%3*4:]+"Buzz"[x%5*4]or x
- from collections import Counter
- print Counter("hello")
- get_ipython().magic(u'logoff')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement