john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

python interpreter example

# import module_name
# module_name.function()

print ( 'binary 0b101 = ' , 0b101 )

for i in range(3):
    print( i )

a = 'python'
b = ' '
c = 'has no types'
print( a + b + c + '\n' )

d = a[2:4]
e = 0b101

#(for i in range(20) if i%2 ==0)
filename = 'c:\python64\hi.py'
f = open( filename , 'r' )

print ( 'python strings, files, lists - sortm = sorted copy of the list' )
print ( 'only lists and dictionaries are mutable' )

print( 'if elif else' )

dict = ('title', 'name' )
for x in dict:
    print( x , 'length: ', len(x) )

print( list(range(10)) )

  • « Amazon aws ec2 to s3 instance backup
  • drupal 6 30 upgrade module steps »

Published

Apr 8, 2011

Category

python

~77 words

Tags

  • interpreter 1
  • python 180
  • repl 1