Issue
I was wondering what does print >> dbfile, key
mean in python. What is the >>
supposed to do?
Solution
It should be noted that the >>
syntax is specific to Python 2.x. In Python 3.x, that syntax goes away and code needs to be changed as follows:
print >>f, "Hello world" # Python 2.x
print("Hello world", file=f) # Python 3.x
Answered By - Greg Hewgill
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.