How can I write this C code in Python?

ivo at nospamAmaze.nl ivo at nospamAmaze.nl
Mon Feb 4 10:36:47 EST 2002


Fred <c at tech.usd253.org> wrote:
: Hello, I am just starting out with Python. I have a very basic book
: that is not helping me much. I have done some simple C programming in
: the past and I think if I could see the below C code done in Python it
: would get me over the beginners hump. I tried to do it in Python but
: got stuck right at the start, Python did not like it when I tried to
: say: for i = 1

: #include <stdio.h>
: int main (void)

: {

: int i;
: int j;

: for (i = 1; i < 13; i++)
: 	{
: 	for (j = 1; j < 13; j++)
: 	  printf("%4d", i*j);
: 	        printf("\n");
:    }
: return 0;
: }

I think you shoud work on your indentation first before trying python. :)

	Ivo


-- 
Drs. I.R. van der Wijk                              -=-
Brouwersgracht 132                      Amaze Internet Services V.O.F.
1013 HA Amsterdam                                   -=-
Tel: +31-20-4688336                          Linux/Web/Zope/SQL
Fax: +31-20-4688337                           Network Solutions
Web:     http://www.amaze.nl/                    Consultancy
Email:   ivo at nospamAmaze.nl                         -=-




More information about the Python-list mailing list