Give a code snippet that is valid in both C and Python, but produces
different results.
Friday, September 12, 2008
Subscribe to:
Post Comments (Atom)
Programming tricks related to ActionScript, Python, C/C++ and Java. See the comments for answers.
1 comment:
#define print(a) printf(10)
print(20)
In C, this prints 10 because of the macro subtitution, but in Python
it prints 20 because the line starting with # is ignored as a comment.
Post a Comment