Input and print
Some useful ways to enter and print
Input:
Differences between input( ) and raw_input( ):
String str we input:
- By input( ): str can't contain blank space
 - By raw_input( ): str can contain blank space, so we can extract some items by using str.split(' ')
Example1:Enter some integers separated by a ( or some ) space .
'''
import string
str = raw_input() #str = '45 12 32 65'
chars = str.split(' ')
ints = []
for i in chars:
ints.append(int(i)) # string to int function: int(str)
print ints #[45,12,32,65]
''' 
print:
- Stand style of print integer:
Example : print '%d * %d = %-3d"%(i,j,result) #%-3d Align right 3 characters. - Several items in a common raw:
print item1,item2, # a , followed items 
                    
                
                
            
        
浙公网安备 33010602011771号