ling1001 - >>> a ['c', 'b', 'a'] >>>...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
inFile = open ('. ..', 'r') *inFile.readline() *inFile.readlines() ##reads all of std in as input## ## in a loop## for line in inFile: a=a+1 is the same as a+=1 IDLE 1.2.1 >>> list('abc') ['a', 'b', 'c'] >>> a= list('abc') >>> a ['a', 'b', 'c'] >>> a.reverse()
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: >>> a ['c', 'b', 'a'] >>> ','.join(a) 'c,b,a' >>> ', '.join(a) 'c, b, a' >>> ''.join(a) 'cba' >>> list('abc') ['a', 'b', 'c'] >>> str(list('abc')) "['a', 'b', 'c']" >>> .join(list('abc)) SyntaxError: invalid syntax >>> ''.join(list('abc')) 'abc' >>>...
View Full Document

This note was uploaded on 09/06/2009 for the course LING 571 taught by Professor Staff during the Fall '08 term at San Diego State.

Ask a homework question - tutors are online