2007/11/16, Mr. SpOOn <[EMAIL PROTECTED]>: > esiste qualche metodo per stampare i primi N numeri in forma binaria? > E la possibilità di stamparli con un numero fissato di bit?
Python 3.0a1+ (py3k:58889, Nov 6 2007, 19:05:24) [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> for i in range(8): ... print( bin(i)[2:].zfill(3) ) ... 000 001 010 011 100 101 110 111 Saluti. -- . Facundo Blog: http://www.taniquetil.com.ar/plog/ PyAr: http://www.python.org/ar/ _______________________________________________ Python mailing list Python@lists.python.it http://lists.python.it/mailman/listinfo/python